停止在二分软件包(plotweb)中切掉绘图边缘

时间:2018-12-03 11:16:48

标签: r bipartite

使用R中的bipartite软件包中的plotweb()函数,我创建了一个网络,但是某些标签对于绘图区域来说太长了。结果,它们的顶部和底部被切断了(我已经附上了图片)。

我正在尝试使其适合绘图,或者在不可能的情况下,能够将其导出为图像而不会切除边缘。

我已经尝试过par(mar = c(),但这似乎没有任何作用。ybig()可以允许上半部分放进去,但不会改变下半部分。

See photo: labels being cut off from the web

1 个答案:

答案 0 :(得分:0)

在这种情况下,似乎可以调整参数y.lim。从help(plotweb)开始,大约有y.lim

  

[...]如果在绘图区域之外绘制标签并用于多营养图[...]

这里是一个例子:

library(bipartite)

data(Safariland)
# Forge some long names/labels
cn <- colnames(Safariland)
rn <- rownames(Safariland)
colnames(Safariland) <- paste(cn, cn)
rownames(Safariland) <- paste(rn, rn)

# plotweb with trying to fit the labels - tweak y.lim until you get it right
plotweb(Safariland, text.rot = 90, y.lim = c(-1.5, 4))

enter image description here