Setting subgraph attributes in Rgraphviz

本小妞迷上赌 提交于 2019-12-12 14:16:24

问题


I'm trying to set a fill color in Rgraphviz for a subgraph. In the documentation, it is implied that you can set subgraph attributes where you set whether or not the subgraph is a cluster, like so:

subGList = list()
subGList[[1]] = list(graph=sg.iip, attrs=c(fillcolor="lightgreen", style = "filled", 
  shape = "rectangle"), cluster = TRUE)

Unfortunately, setting attributes in this manner doesn't seem to have any effect on the plot.

Because my subgraphs contain 20-30 nodes (where the full graph has 250 nodes), it's not really reasonable to code it with the nodewise method where you have to use each node name and set it to the color.

edit My current workaround is to do:

vc <- as.list(rep("lightgreen", length(subgraphNames)))
names(vc) <- subgraphNames

plot(fG.iip.NEL, 'neato', subGList=subGList, nodeAttrs = list(fillcolor=vc))

来源:https://stackoverflow.com/questions/45176209/setting-subgraph-attributes-in-rgraphviz

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!