[R] Log scale in histograms

Jonathan Dushoff dushoff at eno.princeton.edu
Thu Sep 15 04:42:38 CEST 2005

Can't find any information about this, but others must want to do it.

In the example below, the second plot has the desired log scale, but the
first does not.

Any help appreciated.



area_Mh = 259*state.area/1000000

histlogarea = hist(log(area_Mh), 13, xlab="Area (Mh)", main="")
histlogarea$mids = exp(histlogarea$mids)
histlogarea$breaks = exp(histlogarea$breaks)

plot(histlogarea, log="x")

plot(histlogarea$mids, histlogarea$density, log="x")

More information about the R-help mailing list