[英]Change scale of histogram in R
我的直方圖中只有一個 bin。 我怎樣才能以一種方式轉換它,使它有更多的垃圾箱?
我想將附加圖像中的圖 2 轉換為類似於圖 1 的內容,以便我看到更多的垃圾箱。
編輯 :
在做hist(df$FutureCost,main="Multicare Distribution of charges", xlab="Charge($)",breaks="FD",xlim=c(0,500000))
,我得到了一個更好的圖表. 感謝回復。 如何將數字 1e+05、2e+05 等轉換為 100000、200000 等數字?
基於上述評論的完整(但不可重現/可測試)解決方案,並嘗試重現 ggplot 樣式......
opar <- options(scipen=100)
par(bg="gray") ## set plot background color
hist(df$FutureCost,
main="Multicare Distribution of charges",
xlab="Charge($)",
breaks="FD",
xlim=c(0,500000),col="black")
grid(col="white") ## plots on top of histogram; re-plot
## histogram if you like ...
par(opar) ## restore original settings
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.