[R] Italics in plot main title

Uwe Ligges ligges at statistik.tu-dortmund.de
Mon Jun 2 09:04:06 CEST 2008


Example:

n <- c(10,20,30)
par(mfrow=c(2,2))
for(i in seq_along(n))
     plot(1, main=substitute("Relative efficiency for sample size " * 
{italic(n) == ni}, list(ni=n[i])))

Best,
Uwe Liugges


Marcin Kozak wrote:
> Hi,
> 
> I am drawing several plots and want to have italics in a main title;
> this is easy with expression(). However, I want also to add a value to
> it, say n_i, that depends on an ith plot. For this I am using paste().
> An example: n_i = 10, 20, 30; I want to draw a plot for each i with
> the title: "Relative efficiency for sample size n = n_i", where n
> should be in italics, and of course n_i is not specified by value. The
> expression() does not work with paste(). I know this might be easy,
> but can't figure anything, so any ideas how this could be efficiently
> done?
> 
> Thanks in advance,
> Marcin
> 
> ______________________________________________
> 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