[Rd] dotplot: character size of labels (PR#816)

H.RINNER@TIROL.GV.AT H.RINNER@TIROL.GV.AT
Thu, 18 Jan 2001 16:57:18 +0100 (MET)


There seems to be a bug in "dotplot" concerning the "cex" parameter. Setting
cex has no effect on the character size of the labels of the points.
This problem was posted to r-help today (Thu, 18 Jan 2001); the solution
given by Brian Ripley (and Uwe Ligges) seems to work for me.

Heinrich Rinner.
 
> version
         _              
platform i386-pc-mingw32
arch     x86            
os       Win32          
system   x86, Win32     
status                  
major    1              
minor    2.0            
year     2000           
month    12             
day      15             
language R              

> ----------
> Von: 	Prof Brian Ripley[SMTP:ripley@stats.ox.ac.uk]
> Gesendet: 	Donnerstag, 18. Jänner 2001 10:35
> An: 	RINNER Heinrich
> Cc: 	'r-help@stat.math.ethz.ch'
> Betreff: 	Re: [R] dotplot: character size of labels
> 
> On Thu, 18 Jan 2001, RINNER Heinrich wrote:
> 
> > Dear R users,
> >
> > using dotplot (R1.2.0, WinNT4.0), I am trying to change the character
> size
> > of the labels of the points:
> >
> > > # example
> > > data(VADeaths)
> > > dotplot(VADeaths, main = "Death Rates in Virginia - 1940")
> > > # I'd like to have smaller character size of the labels (for age and
> > population groups)
> > > ?dotplot
> > > # for argument "cex", this says: "Setting cex to a value smaller than
> one
> > can be a useful way of avoiding label overlap."
> > > dotplot(VADeaths, main = "Death Rates in Virginia - 1940", cex = 0.5)
> > > # the main title and the plotting characters are smaller now, but not
> the
> > labels
> > > # trying to set other graphics parameters seems to have no effect:
> > > dotplot(VADeaths, main = "Death Rates in Virginia - 1940", cex.axis =
> 0.5)
> > > dotplot(VADeaths, main = "Death Rates in Virginia - 1940", cex.lab =
> 0.5)
> >
> > I'd be grateful for any hint how to do this correctly;
> 
> Looks like a bug. Inside dotplot alter to
> 
>         for (i in 1:n) mtext(labs[i], side = 2, line = loffset,
>             at = y[i], adj = 0, col = color, las = 2, cex = cex, ...)
> 
>         for (i in 1:nlevels(groups)) mtext(glabels[i], side = 2,
>             line = goffset, at = gpos[i], adj = 0, col = gcolor,
>             las = 2, cex = cex, ...)
> 
> However, it really needs more than that to calculate the spaces for the
> labels correctly.
> 
> 
> -- 
> Brian D. Ripley,                  ripley@stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272860 (secr)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
> 

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._