Re: xlim, ylim problem in barplot (PR#325)

About this list Date view Thread view Subject view Author view Other groups

Subject: Re: xlim, ylim problem in barplot (PR#325)
From: Peter Dalgaard BSA (p.dalgaard@biostat.ku.dk)
Date: Tue 16 Nov 1999 - 07:39:20 EST


Message-ID: <x2hfinh1tj.fsf@blueberry.kubism.ku.dk>

mcw@ln.nimh.nih.gov writes:

> Hi, all.
>
> The lower bound in a barplot (or the left bound if you're making a
> horizontal barplot) is -0.01 no matter what. This causes problems if
> you're making a barplot of small values (say, < .001), as most of the plot
> is taken up with blank space beneath the axis, and the bars are squeezed
> in at the top. The fix seems to be simple: replace lines
>
> 41: xlim <- range(-0.01, height)
> 59: ylim <- range(-0.01, height)
>
> by the following:
>
> 41: xlim <- range(max(-0.01, -0.01 * height), height)
> 59: ylim <- range(max(-0.01, -0.01 * height), height)
>
> This seems to work for small negative numbers as well.

or simply range(-0.01*height,height)

That one might just be sneaked into the upcoming release....

-- 
   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-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Tue 04 Jan 2000 - 14:16:10 EST