[R] using subscripts in a plot title with 2 lines

Liaw, Andy andy_liaw at merck.com
Mon Apr 19 19:33:39 CEST 2004


If I understood your problem correctly, one ugly way of getting around this
is to use call mtext() twice to put the two lines in the title area, using
the line argument to mtext to control the location of the lines.  E.g.,
something like:

plot(1, main="")
mtext(expression(IC[50]), line=3, side=3, cex=1.2)
mtext("of My Data", line=1.5, side=3, cex=1.2)

HTH,
Andy

> From: Rajarshi Guha
> 
> Hi,
>   I'm making a plot in which the title takes up two lines. The title
> contains a subscript but when I look at the plot it does'nt 
> seem tocome
> out properly. The code I'm using is:
> 
>    xtxt = expression(paste('Observed -log( ', IC[50], ' )'))
>    ytxt = expression(paste('Predicted -log( ', IC[50], ' )'))
>    mtxt = expression(paste('Plot of Observed vs. Predicted -log(',
> IC[50], ') Values for the PDGFR\nDataset'))
> 
>    plot(tset$V2, tset$V3, xlim = c(-2,2), ylim = c(-2,2),
>     pch = 19, col = "blue", 
>     main=mtxt,
>     xlab = xtxt,
>     ylab = ytxt)
> 
> Removing the IC[50] term makes it come out OK. 
> Is there any way to get around this?
> 
> Thanks,
> 
> -------------------------------------------------------------------
> Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net>
> GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
> -------------------------------------------------------------------
> Does Ramanujan know Polish?
> -- E.B. Ross
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
> 


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments,...{{dropped}}




More information about the R-help mailing list