如何绘制没有背景连接或标签的网络? R pegas

时间:2015-10-26 14:05:41

标签: r plot

我按照this question的说明使用pegas包制作了单倍型网络。它已成功绘制,但从下图中可以看出,绘制了所有连接标签,使图形具有拥挤的外观。我该如何删除它们。

plot(net, size = attr(net, "freq"), pie=ind.hap, fast = TRUE, legend=F, label=NULL, vertices.last=F)
legend('topleft', capitalize(colnames(ind.hap)), col=rainbow(ncol(ind.hap)), pch=20, cex=0.7)

Plotted network

2 个答案:

答案 0 :(得分:2)

我相信您可以通过在threshold = 0来电中设置plot()来调整,即:

plot(net, size = attr(net, "freq"), pie=ind.hap, fast = TRUE, legend=F, label=NULL, threshold = 0)

有关详细信息,请参阅?pegas::plot.haploNet的帮助。另请注意,您提到的帖子(here)有一个错误,其中饼图被错误地着色(我已对其进行了评论并发布了更正的答案here)。< / p>

答案 1 :(得分:0)

您可能想尝试:

plot(net, size = attr(net, "freq"), pie=ind.hap, fast = TRUE, legend=F, label=NULL, vertices.last=F), col=rainbow(ncol(ind.hap)), pch=20, cex=0.7)

这是没有图例的代码(&#39; topleft&#39;,大写(colnames ....)参数。

这有用吗?