一张图片说的超过千言万语.如您所见,我fill
的基础是变量variable
.
然而,在每个条形图中存在多个数据实体(黑色边框),因为离散变量complexity
使它们成为唯一的.我想要找到的东西使得酒吧的每个部分比当前的外观更加可辨.如果它像阴影那样是优选的.
这是一个示例(不同的数据集,因为原始导入):
dat <- read.table(text = "Complexity Method Sens Spec MMC
1 L Alpha 50 20 10
2 M Alpha 40 30 80
3 H Alpha 10 10 5
4 L Beta 70 50 60
5 M Beta 49 10 80
6 H Beta 90 17 48
7 L Gamma 19 5 93
8 M Gamma 18 39 4
9 H Gamma 10 84 74", sep = "", header=T)
library(ggplot2)
library(reshape)
short.m <- melt(dat)
ggplot(short.m, aes(x=Method, y= value/100 , fill=variable)) +
geom_bar(stat="identity",position="dodge", colour="black") +
coord_flip()
Run Code Online (Sandbox Code Playgroud)
Mar*_*ius 29
这远非完美,但希望朝着正确的方向迈出一步,因为它已被躲过variable
,但仍然设法以Complexity
某种方式表现:
ggplot(short.m, aes(x=Method, y=value/100, group=variable, fill=variable, alpha=Complexity,)) +
geom_bar(stat="identity",position="dodge", colour="black") +
scale_alpha_manual(values=c(0.1, 0.5, 1)) +
coord_flip()
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
24048 次 |
最近记录: |