Skip to content
Prev 205263 / 398506 Next

Thin bars in R hist !!??

On 01/04/2010 08:25 AM, Whalojazz wrote:
Hi Whalojazz,
There is the possibility of matching the x axis limits to the range of 
the data:

hist(x, breaks=10, xlim=c(0, 18), axes=FALSE)
axis(2, at=seq(0, 70, 5))
axis(1, at=seq(0, 18, 9))

but this would not leave you all that tempting, empty space in which you 
could insert a cartoon or humorous epigram. Why don't we split the 
difference and try:

x11(width=10,height=7)
hist(x, breaks=10, xlim=c(0, 40), axes=FALSE)
axis(2, at=seq(0, 70, 5))
axis(1, at=seq(0, 40, 10))

Jim