我有一个图形对象,但是当使用布局'sparse_stress‘(也尝试了其他布局)使用graph ()绘制时,后面跟着下面的错误。
最小(度)为1,不存在断开节点。“只支持连通图”的错误是什么意思?
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 in layout_with_sparse_stress(graph, pivots = pivots, weights = weights, : only connected graphs are supported.
发布于 2020-08-18 01:59:51
Min(度)=1表示确实没有断开连接的节点,但仍然可能存在断开连接的图。参见graphlayouts
在github上的自述
如果图形不太大,设置layout="sparse"
应该可以解决您的问题。
发布于 2021-11-26 12:58:29
使用基本的plot
命令将成功地使用igraph绘图算法绘制一个断开连接的图,因此如果您指定ggraph(Subgraph_1994, layout='igraph', algorithm='nicely') + ...
,那么即使在断开连接的图形中,它也应该工作。
https://stackoverflow.com/questions/62743247
复制相似问题