调整窗口大小并为最小设置边距 [英] resizing window and setting margins for minimum
问题描述
我正在尝试创建树形图,并且由于父亲"有很多子代",因此我希望它是一个非常宽的图.因此,我尝试使用windows选项调整窗口大小,并将页边距设置为零宽度,以便获得较宽的图形.这些是我的程序行:
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?
预先感谢
诺姆
推荐答案
默认情况下,igraph
使用方形长宽比,而不管设备的大小如何.
您可以通过将asp
参数设置为0
来禁用此功能.
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)
这篇关于调整窗口大小并为最小设置边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!