简体   繁体   English

如何减少R中x轴上绘制点之间的距离?

[英]How to decrease the distance between plotted points on x axis in R?

I created this strip chart using the following code我使用以下代码创建了此条形图

stripchart(data=sub, Colabelled_Percent~Treatment, vertical=TRUE, 
           ylab='Co-labelled Percent', xlab='Treatment',
           group.names=c("mCherry", "miR-338-3p sensor" ))

but don't seem to be able to decrease the white space between my two Treatment groups.但似乎无法减少我的两个治疗组之间的空白。

You can adjust this using xlim .您可以使用xlim进行调整。 Your two treatments are plotted at x=1 and x=2.您的两个处理绘制在 x=1 和 x=2 处。 Use xlim to include more space.使用 xlim 包含更多空间。 Since you don't provide your data, I illustrate with some sample data.由于您没有提供数据,我用一些示例数据进行说明。

## Sample data 
x     = c(85,92,100, 35,50,80)
Treat = c("A", "A", "A", "B", "B", "B") 

stripchart(x ~ Treat, vertical=TRUE, xlim=c(0,3))

带额外空间的条形图

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

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