Skip to content
Back to formatted view

Raw Message

Message-ID: <4DE81D1A.5080108@ucalgary.ca>
Date: 2011-06-02T23:30:34Z
From: Peter Ehlers
Subject: lattice + plotmath: how to get a variable in bold face?
In-Reply-To: <E2624895-1D0F-4DFF-941E-62EB168F8827@web.de>

On 2011-06-02 15:50, Marius Hofert wrote:
> Dear all,
>
> How can I get a bold "1000" in the title? I would like to use a variable (as opposed to putting in "1000" directly).
>
> library(lattice)
> N<- 1000
> xyplot(0~0, xlab.top=list(label=as.expression(bquote(bold("foo" ~ .(N) ~ "bar"))), font=2, cex=1.2))
> ## =>  "font=2" is ignored (of course)

You could add

  N <- as.character(N)

before your call to xyplot.

Peter Ehlers

>
> Cheers,
>
> Marius
> ______________________________________________
> 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.