简体   繁体   English

r程序并排箱图

[英]r program side-by-side boxplots

I have three different boxplots, 我有三种不同的箱线图,

k1<-boxplot(decreased$Group.1)

k2<-boxplot(unchanged$Group.1)

k3<-boxplot(created$Group.1)

Is there any way I can make side-by-side boxplot with it or do I have to combine the columns for table together and use ~ to find out side by side? 有什么办法可以使它并排箱图,还是必须将表的列合并在一起并使用〜并排找出来?

It can happen but you will need to play with the xlim , ylim , at and add arguments. 它可以发生,但你需要用打xlimylimatadd参数。

See this example: 请参阅以下示例:

boxplot(1:10, xlim=c(1,6), ylim=c(0,20), at=1.5)
boxplot(2:10, add=TRUE, at=3.5)
boxplot(3:20, add=TRUE, at=5.5)

在此处输入图片说明

So, you need to add the x-limits and y-limits on the first plot along with the location of where to plot the first barplot (specified by at ). 所以,你需要用的地方绘制第一barplot(由指定的位置沿加在第一条曲线的x限制和y限制at )。 Then consecutive barplots need the location (ie again at ) and also the add=TRUE argument. 然后,连续的条形图需要位置(即再次at ),还需要add=TRUE参数。

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

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