resizing window and setting margins for minimum

和自甴很熟 提交于 2019-12-19 08:56:44

问题


I'm trying to create a tree graph, and since the "father" has a lot of "children" I'd like it to be a very wide graph. Therefore, I tried to resize the window with the windows option and set margins to zero width in order to have a wide graph. These are my program lines:

windows(heigth=7, width=14, record=TRUE, rescale="fit")
par(mar=c(1,0,1,0), omi=c(0,0,0,0), oma=c(0,0,0,0))
plot(graph_name,layout=layout.reingold.tilford(tree))

I get a wide device window but the plot is in the middle and not wide-spreaded. What am I doint wrong?

Thanks in advance,

Noam


回答1:


By default, igraph uses a square aspect ratio, regardless of the size of the device. You can disable this by setting the asp argument to 0.

library(igraph)
g <- barabasi.game(100)
par(mar=c(0,0,0,0))
plot(g, asp=0)


来源:https://stackoverflow.com/questions/15879293/resizing-window-and-setting-margins-for-minimum

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