Skip to content
Prev 178252 / 398506 Next

font size relative to graphic

On Apr 24, 2009, at 3:14 PM, Mike Miller wrote:

            
The values returned from the barplot function are the locations of the  
bars. Why not call barplot, collect the values, and then use the  
length of the result to determine your sizes and widths?

hh <- t(VADeaths)[, 5:1]
mybarcol <- "gray20"
mp <- barplot(hh, beside = TRUE,
         col = c("lightblue", "mistyrose",
                 "lightcyan", "lavender"),
         legend = colnames(VADeaths), ylim= c(0,100),
         main = "Death Rates in Virginia", font.main = 4,
         sub = "Faked upper 2*sigma error bars", col.sub = mybarcol,
         cex.names = 1.5)

length(mp)  #  [1] 20