Skip to content

y axis on hist

1 message · Jari Oksanen

#
fpgibson at umich.edu said:
If you use instead:

hist(rnorm(100000)); box()

You won't notice anything strange, and you may be satisfied with the result.

The `problem', if there is a problem, is pretty deep in the command axis() used 
by histogram plotting function plot.histogram(), and the behaviour is just same 
as in other R graphs which do not necessarily have tic marks at the axis 
extremes. You can see if you execute sequentially:

plot(rnorm(100), rnorm(100), axes=FALSE)
axis(1); axis(2)
box()

So it's a property, and using box() is the easiest way to hide this property, 
if you don't like it.

cheers, jari oksanen