一个图中的多行绘图 - 如何自动调整x-和y轴以找到所有图形

发布于 2025-01-25 04:14:22 字数 764 浏览 5 评论 0原文

从我以前的问题下关注 R:从数据框中选择向量(数字),样本n = 10个大小i = 5的子集,i = 5和i = 10的向量,并计算这些样品中的每个样本

我想绘制结果2个向量的分布。我正在使用epdfplot创建一个密度,然后将其添加到图中的第二个密度,但是,我有一个问题:Xlim和Ylim被调整为Graph i首先绘制的图形,但添加了图形。

epdfPlot(as.numeric(unlist(vector1)),
     curve.fill = TRUE,
     curve.fill.col = rgb(1, 0, 0, alpha = 0.5),
     epdf.col = "red",
     )

epdfPlot(as.numeric(unlist(IRR_mean_diversified)),
         curve.fill = TRUE,
         curve.fill.col = rgb(0, 0, 1, alpha = 0.5),
         epdf.col = "blue",
         add = TRUE)

但是,我尝试使用值的最小/最大函数来截断图形。

谢谢你!

Following from my previous question here
R: Select vector (numeric) from data frame, sample n=10 subsets of size i=5 and i= 10 within vector and calculate mean for each of these samples

I want to plot the distribution of the resulting 2 vectors. I am using epdfPlot to create one density and then the second one adding it to the plot, however, I have the problem that the xlim and ylim are adjusted for graph I plot first but not for the graph(s) added.

epdfPlot(as.numeric(unlist(vector1)),
     curve.fill = TRUE,
     curve.fill.col = rgb(1, 0, 0, alpha = 0.5),
     epdf.col = "red",
     )

epdfPlot(as.numeric(unlist(IRR_mean_diversified)),
         curve.fill = TRUE,
         curve.fill.col = rgb(0, 0, 1, alpha = 0.5),
         epdf.col = "blue",
         add = TRUE)

I tried with min/max function of the values, however, that truncates the graphs.

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文