Re: [R] barplot

About this list Date view Thread view Subject view Author view

Peter Dalgaard BSA (p.dalgaard@biostat.ku.dk)
08 Dec 1999 16:59:00 +0100



"Zdenek Skala" <Zdenek.Skala@incoma.cz> writes:

> Dear all,
> do anybody know how to set ylim in barplot() correctly? When I
> write:
> > barplot(c(.1,.5,1.0))
> the y-axis goes from 0.0 to 0.8. Wheny I type:
> > barplot(c(.1,.5,1.0,),ylim=range(0:1))
> the y-axis goes from 0.0 to 0.8.

0.2 to 0.8, no?

> Obviously I am doing something wrong. Are the ylim setting
> standards in barplot() other than in plot() or is this a bug?
> Thanks for any hints!
> Zdenek

Yes, and yes. The axis settings use yaxs='i' (or xaxs if horizontal)
which sets the plot boundaries equal to the ylim (stated or computed)
and marks the axes "internally". The endpoints of the axes are not
considered to be internal (this is the bug, they are in Splus).

Quick workaround is:

barplot(c(.1,.5,1.0),ylim=range(-.01,1.01))

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b3 on Tue 04 Jan 2000 - 13:34:02 EST