[R] Tex fonts in R plots

cls59 chuck at sharpsteen.net
Thu Jul 9 18:59:55 CEST 2009



KARAVASILIS GEORGE wrote:
> 
> Hello, R users.
> I would like to display the font of Math Mode of MikTex 2.3, WinEdt 5.4 
> in R plots, e.g. in xlab, ylab or legend.
> How can I do that?
> Thank you in advance.
> 
> 

A colleague and I have developed a package called pgfSweave that turns R
plots created inside a Sweave document into code that can be interpreted by
PGF/TikZ package for LaTeX. The end result of this process is that the text
in your figures are typeset with the same fonts used in the rest of your TeX
document.

The package can be found at: 

http://r-forge.r-project.org/projects/pgfsweave/
 
It has been used by the authors to typeset academic papers on windows and
produces good results. However we are still classifying it as an alpha
product because it has not been tested extensively.

Currently the underlying utility that translates R graphics into PGF form is
the java utility eps2pgf which may be found at:

http://sourceforge.net/projects/eps2pgf/

You may be interested in using this utility by it's self if you just want to
prep graphics for LaTeX and don't want to use Sweave. Simply create your
graphs in R using the eps() driver and process them using eps2pgf. 

eps2pgf has some drawbacks- it takes a few seconds to translate a graph and
certain R graphics commands, such as setting text size using cex, are not
respected.

Good luck!

-Charlie


-----
Charlie Sharpsteen
Undergraduate
Environmental Resources Engineering
Humboldt State University
-- 
View this message in context: http://www.nabble.com/Tex-fonts-in-R-plots-tp24382492p24414007.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list