R ggplot中的多个异常值->;alpha到异常值。颜色
我想将箱线图中的异常点设置为半透明 在实验中,他们使用了“抖动”(类似的想法,不同的方法) 我的代码R ggplot中的多个异常值->;alpha到异常值。颜色,r,alpha,boxplot,R,Alpha,Boxplot,我想将箱线图中的异常点设置为半透明 在实验中,他们使用了“抖动”(类似的想法,不同的方法) 我的代码 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 ",
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 G24
在上述链接中,他们修改了函数geom_boxplot
;我希望有更简单的方法,比如outlier.color=alpha(“黑色”,1/2)
,但这会产生错误:
Error in do.call("layer", list(mapping = mapping, data = data, stat = stat, :
could not find function "alpha"
非常感谢您的帮助。自
ggplot2
0.9.0版起,alpha
功能已移至(然后是新的)scales
软件包中。要使用它,您需要包括
library("scales")
除了
library("ggplot2")
在你的剧本里