[R] PlotMoth Refusing to Draw xlab

Ross Ihaka ihaka at stat.auckland.ac.nz
Fri Sep 26 05:23:42 CEST 2003

Frank E Harrell Jr wrote:
> Occasionally I have had plotmath refuse to draw x-axis labels.  This has happened when the label, created using expression(paste( ) ) as below, could be drawn easily in the available space.  I have not reproduced that, but the following example with a clearly overly long label results in no xlab at all.  I hoped that at least a truncated label would be plotted.  This is probably related to my original problem.
> plot(0,0,xlab=expression(paste('1234567890abcdefghijklmnopqrstuvwzyz abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPARSTUVWXYZ')))
> platform i386-pc-linux-gnu
> arch     i386             
> os       linux-gnu        
> system   i386, linux-gnu  
> status                    
> major    1                
> minor    7.1              
> year     2003             
> month    06               
> day      16               
> language R                
> Thanks for any assistance  -Frank

I believe this is a clipping problem.  Strings placed outside the device 
area are clipped (this is to nasty avoid problems with some devices).
This means discarding the entire string.  Plain text strings and
expressions are handled differently in this regard, but there will be
a unification of this in the near future and that may be the time to
address it.

The only work around I can suggest is using larger margins.

Ross Ihaka                         Email:  ihaka at stat.auckland.ac.nz
Department of Statistics           Phone:  (64-9) 373-7599 x 85054
University of Auckland             Fax:    (64-9) 373-7018
Private Bag 92019, Auckland
New Zealand

More information about the R-help mailing list