如何在没有背景连接或标签的情况下绘制网络?飞马 [英] How to plot a network without background connection or labels? R pegas

查看:44
本文介绍了如何在没有背景连接或标签的情况下绘制网络?飞马的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照

解决方案

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

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

有关详细信息,请参阅 ?pegas::plot.haploNet 的帮助.另请注意您提到的帖子 (here) 有一个错误,即饼图的颜色错误(我对此发表了评论并发布了更正的答案 此处).

I have made a haplotype network using the pegas package following the instructions from this question. It has successfully plotted but as you can see from the following figure, all the connection labels are ploted giving the graph a crowded appearance. How can I remove these.

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)

解决方案

I believe you can adjust that by setting threshold = 0 in your plot() call, that is:

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

See help for ?pegas::plot.haploNet for more details. Also please note that the post you mention (here) has a bug where the pie-chart is being coloured wrongly (I've made a comment about it and also posted a corrected answer here).

这篇关于如何在没有背景连接或标签的情况下绘制网络?飞马的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆