我想将箱线图中的离群点设置为在here!中是半透明的他们使用了“抖动”(类似的想法,不同的方法)
我的代码
ggplot() +
geom_boxplot(aes(x = Sistema, y=values, linetype = Sistema),
data=estacado, outlier.size=1, outlier.shape=2) +
coord_flip() +
labs(x="Sistema", y=expression(paste("RMSD ",(ring(A))))) +
opts(legend.position="none")我的数据
>head(estacado)
values ind Sistema
1 0.310214 r24_a R24
2 0.428232 r24_a R24
3 0.460971 r24_a R24
4 0.482923 r24_a R24
5 0.492656 r24_a R24
6 0.515591 r24_a R24
> tail(estacado)
values ind Sistema
4999995 1.723030 g24_e G24
4999996 1.718444 g24_e G24
4999997 1.720745 g24_e G24
4999998 1.737137 g24_e G24
4999999 1.733106 g24_e G24
5000000 1.738487 g24_e G24http://dl.dropbox.com/u/19202810/Rplot01.png http://dl.dropbox.com/u/19202810/Rplot01.png
在上面提到的链接中,他们修改了函数geom_boxplot;我希望像outlier.colour= alpha("black", 1/2)这样更简单的函数,但这给出了错误:
Error in do.call("layer", list(mapping = mapping, data = data, stat = stat, :
could not find function "alpha"任何帮助都是非常感谢的。
发布于 2012-05-23 02:34:32
从ggplot2版本0.9.0开始,alpha函数被移到(然后是新的) scales包中。要使用它,您需要包含
library("scales")除了……之外
library("ggplot2")在你的脚本中。
https://stackoverflow.com/questions/10697504
复制相似问题