[R] Hmisc curve label size & cex

Frank E Harrell Jr f.harrell at vanderbilt.edu
Sat Apr 28 14:59:56 CEST 2007


Brian O'Connor wrote:
> R-Masters,
> 
> I need to produce high resolution line plots and place labels on the 
> curves. It seems that cex must be high relative to the other cex 
> values in order to produce sufficiently large & legible tick labels 
> at high resolutions. But high cex values cause the curve labels to 
> become gigantic when using Hmisc. I've struggled and searched the 
> archives, but cannot find a way of controlling the sizes of the curve 
> labels in this situation.
> 
> These commands produce the problem on my PC using XP:
> 
> 
> png("trial.png", width=3000, height=2400, res = 600, pointsize=12 )
> par(ann=F, font.main=1, font.lab=1, font.axis=1, cex=5, cex.main=1, 
> cex.lab=1, cex.axis=1,
>     lwd=12, las=1, mar=c(4, 4, 2, 2)   )
> 
> x = seq(-2.5, 2.5, length=100)
> 
> labcurve( list( One=  list( x,sin(x)), Two=  list( x,cos(x)),
>    Three=list( x,(x*x)), Four= list( x,exp(x)) ),
>    keys=c('1','2','3','4'),  keyloc="none", pl=TRUE )
> 
> dev.off()
> 
> 
> Thanks for your time.
> 

cex.main .lab .axis etc. are relative so yo need for your case to 
specify something like cex.axis=1/5

Not sure why you are using keys of 1-4 when you've already given nice 
labels.  I tried

  labcurve( list( One=  list( x,sin(x)), Two=  list( x,cos(x)),
     Three=list( x,(x*x)), Four= list( x,exp(x)) ),
     pl=TRUE )

and got some nice output after reducing cex.*

Frank

-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University



More information about the R-help mailing list