在R中如何控制线和点图中点的间距
所以我在 R 中有一个 plot()
,其中 type = "o"
这样我就可以同时拥有线和点。但我发现情节中比较恒定的部分有太多的点。那么,有没有办法让我增加该图中每个点之间的间距。
So I have a plot()
in R with type = "o"
so that I can have both line and points. But I find that there are far too many points in the more constant parts of the plot. So, is there a way for me to increase the spacing between each individual points in this plot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我将使用 type='l' 绘制线条,然后返回并使用点函数仅添加您想要的点。
I would plot the lines using type='l', then go back and use the points function to add just the points that you want.
我建议您查看用于在 R 中绘制图形的 ggplot2 包。有多种选项可用于处理过多的点,我最喜欢的是包含 alpha 值,以便读者可以看到 1 个点和 10 个重叠点之间的差异。
I would recomend you look at the ggplot2 package for drawing graphs in R. This has several options for dealing with an over abundance of points, my favorite is including an alpha value so the reader can see the difference between one point and ten overlaid.
请参阅
help(par)
以及线型的讨论。编辑:或者尝试以下操作:
使用六种预定义的线类型绘制六条线。
Please see
help(par)
and the discussion of line types.Edit: Or just try the following:
which plots six lines with the six pre-defined line types.
与 PaulHurleyuk 提出的建议类似,但使用 Bioconductor geneplotter 包:
Similar to the advice proposed by PaulHurleyuk but using the Bioconductor geneplotter package: