Reputation: 201
I have a graph object, but when plotted using ggraph() using layout 'sparse_stress' (also tried other layouts), it is followed with the below error.
The min(degree) is 1. There are no disconnected nodes. What does the error mean by "only connected graphs are supported"?
Subgraph_1994 = asIgraph(Subgraph_1994)
#sparse-stress gives error
ggraph(Subgraph_1994_Rev,layout="sparse_stress") + geom_edge_link() + geom_node_point() + theme_graph()
#also tried below but same error
ggraph(Subgraph_1994) + geom_edge_link() + geom_node_point() + theme_graph()
Error Message
Error in layout_with_sparse_stress(graph, pivots = pivots, weights = weights, : only connected graphs are supported.
Upvotes: 1
Views: 1077
Reputation: 33
Using the basic plot
command will successfully plot a disconnected graph using the igraph plotting algorithms, so if you specify ggraph(Subgraph_1994, layout='igraph', algorithm='nicely') + ...
then it should work even with disconnected graphs.
Upvotes: 0