[R] box doesn't surround words in legend in printed output

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Aug 8 18:44:10 CEST 2001


Paul Johnson <pauljohn at ukans.edu> writes:

> I have made a plot with a legend and on the screen it looks fine, but
> when I save as jpg or pdf, or print, the legend box is too small, it
> cuts through the words on the right side.
> 
> I put an example here:
> http://lark.cc.ukans.edu/~pauljohn/R/apdftest.pdf
> 
> Is there a work around? 

Sort of. The key is that "replaying" graphics is not smart enough when
a graph is resized, and this effectively happens when you copy a graph
between devices. If your screen image has different (formal)
dimensions and pointsize, the stringwidths used for sizing the legend
box are not recalculated. You can either generate your plots directly
to the target device, or adjust your screen image size to fit the
target using the options to x11()/windows().

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at 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 at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list