[R] Problem with text() and pdf()

Agustin Lobo alobo at paleo.ija.csic.es
Mon Jul 22 18:24:12 CEST 2002


Solved adding xpd=TRUE to the text() call as you
suggested.

Thanks!

Agus

Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo at ija.csic.es


On Mon, 22 Jul 2002, Prof Brian D Ripley wrote:

> My guess is clipping.  R clips in pdf() by omitting the whole text if any
> part of it is clipped.  Try xpd=TRUE.
> 
> BTW, this is a function of R's graphics engine and not of the PDF device
> per se: it happens that X11 and PostScript support clipping, and PDF does
> not (at the level used).
> 
> On Mon, 22 Jul 2002, Agustin Lobo wrote:
> 
> > Hi!
> >
> > I run a function in which I fit a linear
> > model, split the graphic window with
> > layout, plot the data and the linear fit to the left,
> > and the equation to the right using text() in this
> > way (probably there's a better way):
> >
> > par(pty="m")
> > plot(c(0,1),c(0,1), type="n",axes=F,xlab="",ylab="")
> > text(0.25,0.5, paste("y = ",round(a$coefficients[1],3),"+"
> > ,round(a$coefficients[2],3), "* x" ),cex=1)
> >
> > I have no problems using x11() and postscript()
> > (R.1.5.1 for linux). But
> > if I use a pdf display the text from the text() function does not
> > appear (although the plot is correct).
> > Does anyone know what the problem is?
> > I've not found any clue in help(pdf) and I've
> > tried a couple of pdf visors.
> >
> > Thanks
> >
> >
> > Agus
> >
> > Dr. Agustin Lobo
> > Instituto de Ciencias de la Tierra (CSIC)
> > Lluis Sole Sabaris s/n
> > 08028 Barcelona SPAIN
> > tel 34 93409 5410
> > fax 34 93411 0012
> > alobo at ija.csic.es
> >
> >
> >
> > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> > 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
> > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> >
> 
> -- 
> Brian D. Ripley,                  ripley at 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-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