[英]How to use the points function in the horizontal with a stripchart plot in R?
I am trying to get a stripchart with their medians in the horizontal.我想得到一个带中位数水平的条形图。 In the stripchart
function there is a parameter that allows you to do that ( vertical=F
) but I cannot find a similar parameter to draw the medians in the horizontal using points
.在stripchart
函数中,有一个参数允许您这样做( vertical=F
),但我找不到类似的参数来使用points
绘制水平中的中位数。
My example:我的例子:
median <- tapply(mtcars$mpg, mtcars$gear, median)
stripchart(mpg ~ gear,
data = mtcars,
main = "title",
xlab = "x axis",
ylab = "y axis",
col = c('green', 'blue', 'purple'),
pch = 16,
cex = 0.8,
method = 'jitter',
vertical = F)
points(x=c(median), pch="--", cex=5)
This is what I am getting right now:这就是我现在得到的:
This is what I would like to have (but instead of in the vertical way, I want in the horizontal way).这就是我想要的(但不是垂直方式,我想要水平方式)。 [Same code than before but using vertical = F
]. [与以前相同的代码,但使用vertical = F
]。
Does anyone know how can I do it?有谁知道我该怎么做?
Thanks very much in advance首先十分感谢
Regards问候
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.