Philip Boland
2006-Nov-23 11:46 UTC
[R] Using roman and italic fonts in an xlab expression for a plot
Just wondering if it is possible to put something like "The excess level is M" in the xlab position of a plot but where the M is in italic font and the rest in ordinary (or Roman) font. Thanks - Phil Boland
David Barron
2006-Nov-23 12:35 UTC
[R] Using roman and italic fonts in an xlab expression for a plot
Something like: xlab=expression(paste("The excess level is",italic(" M"))) in your plot command should do the trick. See ?plotmath. On 23/11/06, Philip Boland <philip.j.boland at ucd.ie> wrote:> Just wondering if it is possible to put something like > > "The excess level is M" > > in the xlab position of a plot but where the M is in italic font and > the rest in ordinary (or Roman) font. > > Thanks - Phil Boland > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >-- ================================David Barron Said Business School University of Oxford Park End Street Oxford OX1 1HP
Gabor Grothendieck
2006-Nov-23 12:53 UTC
[R] Using roman and italic fonts in an xlab expression for a plot
Try this: plot(1, xlab = quote("Level is" ~ italic(M))) or plot(1, xlab = quote(Level ~ is ~ italic(M)) On 11/23/06, Philip Boland <philip.j.boland at ucd.ie> wrote:> Just wondering if it is possible to put something like > > "The excess level is M" > > in the xlab position of a plot but where the M is in italic font and > the rest in ordinary (or Roman) font. > > Thanks - Phil Boland > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >
Gabor Grothendieck
2006-Nov-24 12:51 UTC
[R] Using roman and italic fonts in an xlab expression for a plot
or even shorter: plot(1, xlab = "Level is" ~ italic(M)) On 11/23/06, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:> Try this: > > plot(1, xlab = quote("Level is" ~ italic(M))) > > or > > plot(1, xlab = quote(Level ~ is ~ italic(M)) > > > On 11/23/06, Philip Boland <philip.j.boland at ucd.ie> wrote: > > Just wondering if it is possible to put something like > > > > "The excess level is M" > > > > in the xlab position of a plot but where the M is in italic font and > > the rest in ordinary (or Roman) font. > > > > Thanks - Phil Boland > > > > ______________________________________________ > > R-help at stat.math.ethz.ch 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. > > >