简体   繁体   English

如何通过r将两个图合并在一帧中?

[英]How to combine two plots in one frame by r?

I can create plots of two groups in one window but I don't know how to combine two plots in one frame with same x and y axis lines.我可以在一个窗口中创建两组图,但我不知道如何将两个图与相同的 x 和 y 轴线组合在一帧中。 The example is as same as the linked image.该示例与链接图像相同。 I would be grateful if someone can help me to do this with R.如果有人能帮我用 R 做到这一点,我将不胜感激。

Please click here to view the image 请点击此处查看图片

Try, using cbind function尝试,使用cbind函数

boxplot(cbind(boxplot1, boxplot2))

This will display the two boxplots in same frame with combined x and y axes.这将在具有组合的 x 和 y 轴的同一帧中显示两个箱线boxplots

Example:例子:

plot(x,y)
par(new=TRUE)
plot(x,y)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM