当我在r中绘制这个ggplot时,我的y轴标记在0和1之间。我不明白它来自何处,因为我的值不仅仅介于0和1之间?我希望我的y轴代表我的数据框的值。
以下是我的数据示例:
mydata<-data.frame(
value=runif(6,0,100),
type=rep(c("a","b"),6),
animal=c("h","h","c","c","c","h"),
eval=c(1,2,1,2,1,1),
frame2=letters[1:6])
ggplot(mydata,aes(x = frame2, y = value, fill=type)) +
theme_classic()+
scale_fill_manual(values=c('#bcbbb8','#FFFFFF','#ffce0c'))+
geom_bar(position = "fill",stat = "identity")+
facet_grid(animal ~ eval)
head(mydata)
value type animal eval frame2
1 76.190681 a h 1 a
2 82.086541 b h 2 b
3 14.002725 a c 1 c
4 67.064677 b c 2 d
5 3.035823 a c 1 e
6 55.560134 b h 1 f