[R] Centring ticks on hists
MSchwartz at medanalytics.com
Sun Sep 7 15:57:13 CEST 2003
On Sun, 2003-09-07 at 05:23, Philip Rhoades wrote:
> Hi people,
> hist(rnorm(200, 10, 3), breaks=20)
> - how do I centre the ticks below each hist rectangle?
> Philip Rhoades
hist() returns a list of elements, one of which is 'mids', which are the
cell centers. Thus, use something like:
hist.data <- hist(rnorm(200, 10, 3), breaks=20, axes = FALSE)
axis(1, at = hist.data$mids)
See ?hist for more information.
More information about the R-help