[R] disappointed with x-axes in hist and density plots

Rishi Ganti rishi at iqmail.net
Thu Jun 17 19:28:57 CEST 2004


Thanks, but even with axis() I can't get the x-axis to extend to the sides.

Try, e.g., 

x = rnorm(1000)

you should have some values in excess of 3 (or below -3).

I want to draw the x-axis from -4 to 4, thus encapsulating all points.

axis(1,-4:4)

but it won't draw. It TRIES to draw it, but I don't see a -4 or 4 on the plot.


----- Original Message -----
From: Thomas Lumley
Sent: 6/17/2004 9:53:33 AM
To: rishi at post.harvard.edu
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] disappointed with x-axes in hist and density plots

> On Thu, 17 Jun 2004, Rishi Ganti wrote:
> 
> > I've got a few issues with the x-axes in the histogram and density plots.  First,
> > often the default x-axis doesn't even extend to the length of my data. R often draws
> > histogram bars  (or density lines) farther than the drawn x-axis extends. For example,
> > I might have a histogram bar at -15,000. But I wouldn't know that, because the most
> > negative number on the x-axis is -10,000.  The second issue is the use of scientific
> > notation. Yes I can read it, but I don't prefer it. Is there any way for R just
> > to print out 1000000 and not 1e+6 on these charts?  Thanks for your help.  Rishi
> >
> 
> You can use the axis() function to draw axes with any set of labels you
> want.
> 
> 	-thomas




More information about the R-help mailing list