2017-10-28 107 views
0

我使用geom_histogram绘制的直方图:R:从geom_histogram图表卸下负对数刻度

ggplot(middle_single, aes(clustersize)) + geom_histogram(binwidth = 100, drop=TRUE) +scale_y_log10(limits=c(0.1,100)) 

但它示出了具有零个计数(日志的0为负INF)的二进制位的负值,但我想从我的图表中删除它们。我怎样才能做到这一点? enter image description here

我查了网络上的许多问题,但其中实际上不解决我的问题(Histogram with "negative" logarithmic scale in RHow to suppress zeroes when using geom_histogram with scale_y_log10

+0

您使用的是哪个版本的'ggplot2'?我无法复制2.2.1中的向下栏 –

回答

0

或许从数据修剪呢?

trimmed_data <- middle_single[middle_single$clustersize >=0,] 

然后情节?