[R] Cross-platforms solution to export R graphs

cls59 sharpsteen at mac.com
Mon Apr 13 03:33:34 CEST 2009



Philippe Grosjean wrote:
> 
> 
> ..I would be happy to receive your comments and suggestions to improve 
> this document.
> All the best,
> 
> PhG
> 
> 

LaTeX is my personal tool of choice and the vector format I use most often
is  http://sourceforge.net/projects/pgf/ PGF  (Portable Graphics Format),
implemented via a LaTeX package written by Till Tantu. There exists a very
nice converter called  http://sourceforge.net/projects/eps2pgf/ eps2pgf 
which is written in java and does an excellent job of translating R eps
output. The primary advantage of PGF is that figure text gets typeset by the
LaTeX engine instead of by R which unifies font choices and gives the final
document a very consistent, professional look. LaTeX commands, such as
mathematical typesetting, can also be embedded in the figure.

Along with a friend of mine, I have been working on a R package that extends
Sweave to include pgf graphics output. Currently 
http://www.rforge.net/pgfSweave pgfSweave  uses eps2pgf to perform the
conversions but a native R graphics device is planned to help speed up the
process. The package is currently very much a beta and has been developed
and tested on Mac OS X and runs quite well. Limited testing has been
conducted on Linux and Windows and we have produced documents on those
systems. Heavy development is expected to take place this summer.

PGF is a human-readable format and can be be easily annotated by adding
additional commands to the resulting file. However, editing the original
content is possible but difficult due to the lack of structure in the
eps2pgf output. The LaTeX environment can even be switched from pgfpicture
to tikzpicture which allows the use of TiKZ- a high level graphics language
built on top of PGF. TiKZ/PGF is easy to learn and the manual is one of the
best pieces of software documentation I have seen. 

Since I came across PGF a couple of years ago, Adobe Illustrator has
languished unused on my hard drive except for the occasional application of
Live Trace. An excellent showcase of PGF/TiKZ examples along with additional
tools is hosted at  http://www.texample.net Texample .

The end result of the PGF/TiKZ build process is a PDF which makes it very
portable.

All the best!

-Charlie

-----
Charlie Sharpsteen
Undergraduate
Environmental Resources Engineering
Humboldt State University
-- 
View this message in context: http://www.nabble.com/Cross-platforms-solution-to-export-R-graphs-tp22970668p23016682.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list