我想知道在使用时是否有办法改变边缘厚度 tkplot()
我知道你可以通过右键单击边缘并手动更改它来完成它,但我希望能够调用一个属性用于边缘.类似于在我可以做的igraph中使用正常绘图功能edge.width=E(g)$Weight
另外,有没有办法将tkplot保存为png而不使用其他包?谢谢!
是的,您可以更改边缘宽度,实际上它的工作方式与完全相同plot().
Tk画布不支持PNG格式,因此无法tkplot()在PNG中保存输出.如果tkplot()用于调整坐标,则使用tkplot.getcoords()查询调整后的坐标,然后使用plot()这些坐标创建PNG文件.
library(igraph)
g <- graph.ring(10)
id <- tkplot(g, edge.width=1:10)
## Now adjust the coordinates by hand, and then continue.
## E.g. I moved vertex 7 to the middle
co <- tkplot.getcoords(id)
png("output.png")
plot(g, layout=co, edge.width=1:10)
dev.off()
Run Code Online (Sandbox Code Playgroud)

| 归档时间: |
|
| 查看次数: |
2246 次 |
| 最近记录: |