[R] greek letters in "italic" font

Gabor Grothendieck ggrothendieck at gmail.com
Mon Aug 4 14:01:18 CEST 2008


You could piece it together using the Hershey fonts for the italic rho:

op <- par(xpd = NA)
plot(1, type = "n", ylab = "")
u <- par("usr")
text(u[1] - .1 * diff(u[1:2]), 1, "\\*r", vfont = c("serif", "italic"))
par(op)

Now add the rest.
?Hershey
?par
?strwidth

On Mon, Aug 4, 2008 at 7:12 AM, Luis Tercero
<luis.tercero at ebi-wasser.uni-karlsruhe.de> wrote:
> Dear HelpeRs,
>
> I am trying to write axis labels with some letters in cursive for later
> inclusion in a LaTeX document. The following code does what I want with
> latin letters (c cursive and the rest not cursive):
>
> plot(1:10, 1:10, ylab = expression(italic(c)*(MB)))
> or
> plot(1:10, 1:10, ylab = expression(paste(italic(c)*(MB), "  /  ",
> mu*g~L^{-1}))
>
> but it does not work for greek letters:
> plot(1:10, 1:10, ylab = expression(italic(rho)*(MB)))
>
> Using text() or mtext() with the option font = 3 does not work either.
>
> I found a way around this by writing "rho" and then having "rho" be changed
> to the corresponding greek letter in LaTeX by using the PSfrag package...
> but it only works for text(), not for mtext() nor xlab/ylab within the
> plot() command.
>
> I would be grateful for some ideas.
>
> Many thanks and best regards,
>
> Luis
>
> --
>
> Luis Tercero, M.Sc.
>
> Engler-Bunte-Institut der Universität Karlsruhe (TH)
> Bereich Wasserchemie
> Engler-Bunte-Ring 1
> D-76131 Karlsruhe
> Tel. +49 721 608 6381
> Fax: +49 721 608 7051
>
> ______________________________________________
> R-help at r-project.org 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.
>



More information about the R-help mailing list