2016-02-02 233 views
2

基本圖形,一些虛擬數據,以說明我的情況:更改直方圖的尺寸標籤

dat <- rnorm(n = 1000, m = 0, sd = 1) 
hist(dat, breaks = 5, labels = TRUE, freq = TRUE, main = "Title") 

我加了倉的標籤。現在,我想改變它們的大小。我知道有很多可以用cex參數來完成:

hist(dat, breaks=5, labels = TRUE, freq = TRUE, main = "Title", cex.main = 0.5) 

然而,它似乎並沒有處理吧標籤。

任何解決方案?

回答

3

嘗試:

H <- hist(dat, breaks = 5, main = "Title") 
text(x = H$mids, y = H$counts, labels = H$counts, cex = 0.5, pos = 3)