2017-10-28 109 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,] 

然後情節?