Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R ggplot中的多个异常值->;alpha到异常值。颜色_R_Alpha_Boxplot - Fatal编程技术网

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")
在你的剧本里