[R] how to change the position of xlab in truehist?

Hua Li hualihua at yahoo.com
Sat Apr 17 00:00:34 CEST 2010


Hi,

I'm wondering how can I change the position of xlab in truehist. For example, the following code creats a histogram with 4 bins for my discrete data. I want each bin to be labelled as 0, 1, 2, or 3 in the middle, so that it's clear each bin corresponds to each of the discrete case. 

I was thinking of first delete xlab and then add marks myself, but it doesn't look like it's working. The old label can not be removed by setting xlab="" or xlab = NULL.

Thanks for your help!

Hua

#------------------------
x = c(rep(0,10),rep(1,100),rep(2,50), rep(3,30))
library(MASS)
truehist(x,nbins=4)

truehist(x,nbins=4,xlab="")



More information about the R-help mailing list