當用color
和fill
自變量呼叫geom_histogram()
時,ggplot2
會混淆繪製整個x軸範圍,從而無法在視覺上區分低值和零值。當使用ggplot2時,我可以設置直方圖條的顏色而不會掩蓋低值嗎?
運行下面的代碼:
ggplot(esubset, aes(x=exectime)) + geom_histogram(binwidth = 0.5) +
theme_bw() + scale_x_continuous(breaks=seq(0,20), limits=c(0,20))
將導致
這是視覺上非常吸引人。爲了解決這個問題,我想改用
ggplot(esubset, aes(x=exectime)) + geom_histogram(binwidth = 0.5,
colour='black', fill='gray') + theme_bw() +
scale_x_continuous(breaks=seq(0,20), limits=c(0,20))
這將導致
的問題是,我不會有區別的方式exectime
是否包含過去的10個值,例如,少數情況下的12會隱藏在橫跨整個x軸的水平線後面。
你介意使用logaritmic縮放嗎? –
也許手動進行聚合?你正在用'limits'參數引起這種行爲。 – hrbrmstr