R ggplot2直方图和facet_grid填充条形

时间:2016-08-18 05:16:04

标签: r ggplot2

尝试使用直方图生成facet_grid我最终得到了一些条形填充条,通常填满整个图。

这里我附加了一个产生问题的示例代码:

p<- ggplot(test, aes(x=value,fill=Tipo)) + geom_bar() + geom_histogram(binwidth=0.1, colour = "black")

p + facet_grid(variable ~ Bloque) + ggtitle("Aroma")+xlab("PGA [g]")+ylab("Frecuencia")

测试数据(csv)是这样的:

"","X","FID","Shape..","Id","Area","Nombre","MegaRM","Estado","Distribuci","Ancho","L","Ld","Dd","H","L2","Ldiagonal","Ang","Volumen","Longitude","Latitude","H_L","Nombre_vie","Tipo","ORIG_FID","Ruiz2014","Flexura","Bloque","variable","value"
"111",111,197,"Point",0,2154209.498,"R7","Sí",NA,NA,0,0,0,0,0,0,0,0,0,458597.0194,7862435.389,0,"R3N","Deslizamiento compuesto",197,0.229818,"Soga","Bloque colgante","PGAv, Ambraseys & Douglas (2003)",0.463383

有没有人对我做错了什么有任何线索?

0 个答案:

没有答案