hi, I've noticed a small problem trying to include postscript plots generated by R into a latex document. Specifically, the latex package graphicsx allow you to specify the bounding box of the postscript file, so that you can just show _part_ of the postscript file if you tell it to also clip the area outside of the bounding box. I've previously used this LaTeX feature without problems on postscript files produced e.g. by gnuplot. However, this doesn't work on R files. Here is a simple example: % R --vanilla R : Copyright 2000, The R Development Core Team Version 1.1.0 (June 15, 2000)> t <- runif(40); > postscript(file="try.ps") > plot(t) > dev.off()null device 1 here is the sample latex file that should include try.ps and just show the central part of that postscript file: \documentclass[12pt]{article} \usepackage{graphicx} \begin{document} \fbox{\includegraphics[bb=200 200 300 300,width=4cm,clip=true]{try.ps}} \end{document} However, when this is run through latex and dvips, the whole of try.ps, rather than just a central region, is included in the output. Has anyone else noticed this? Cheers, Stephen -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter Dalgaard BSA
2000-Aug-01 13:38 UTC
[R] problem clipping R postscript plots within latex
Stephen Eglen <stephen at cogsci.ed.ac.uk> writes:> hi, > > I've noticed a small problem trying to include postscript plots > generated by R into a latex document. Specifically, the latex package > graphicsx allow you to specify the bounding box of the postscript > file, so that you can just show _part_ of the postscript file if you > tell it to also clip the area outside of the bounding box. I've > previously used this LaTeX feature without problems on postscript > files produced e.g. by gnuplot. However, this doesn't work on R > files. Here is a simple example:Ow. This stems from the use of "initclip" in the R-generated PS. One shouldn't do that, one should bracket clipped graphics within gsave/grestore instead. Sounds a bit tricky to get right. -- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._