Tex fonts in R plots

3 messages Options
Embed this post
Permalink
KARAVASILIS GEORGE

Tex fonts in R plots

Reply Threaded More More options
Print post
Permalink
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.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Paul Murrell

Re: Tex fonts in R plots

Reply Threaded More More options
Print post
Permalink
Hi


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.


See http://www.stat.auckland.ac.nz/~paul/R/CM/CMR.html and
"Non-standard fonts in PostScript and PDF graphics" in
http://cran.r-project.org/doc/Rnews/Rnews_2006-2.pdf

Paul


> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
[hidden email]
http://www.stat.auckland.ac.nz/~paul/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Sharpie

Re: Tex fonts in R plots

Reply Threaded More More options
Print post
Permalink
In reply to this post by KARAVASILIS GEORGE
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