[R] two lines in axis title combined with 'substitute' command

Uwe Ligges ligges at statistik.tu-dortmund.de
Thu Jan 3 17:00:15 CET 2013



On 03.01.2013 15:00, N.Hubner at ncmls.ru.nl wrote:
> Hello,
>
> I want to have the x-axis title of my plot in 2 lines, centered:
>
> experiment 1:
> log2(Ratio H/L)
>
> I know that in principle that works with '\n'. However, I am also using the 'substitute' command for my axis title. However, it does not make a new line.

You cannot. One way out is to use two calls to title(xlab=...., 
line=...), one for each line of the xlab title.

Best,
Uwe Ligges


>
> What I have so far:
>
> logbase <- 2
> test <- "bait"
> cellline <- "cellline"
>
> plot(
> log(filteredproteins[["Ratio.H.L.normalized.UW21_FW"]],base=logbase),
> -log(filteredproteins[["Ratio.H.L.normalized.UW21_REV"]],base=logbase),
> main= substitute("bait = "* bait *" in "*cellline, list(bait=bait, cellline=cellline)),
> xlab = substitute(
> log[logbase]*
> ("Ratio H"/"L forward")*
> italic("\n experiment 1"),
> list(logbase=logbase)
> ),
> ylab = substitute(
> log[logbase]*
> ("Ratio L"/"H reverse")*
> italic("\n experiment 2"),
> list(logbase=logbase)
> ),
> col="lightblue",
> bg="black",
> pch=16
> )
>
> Thanks for your help!
> Nina
>
>
>
> The Radboud University Nijmegen Medical Centre is listed in the Commercial Register of the Chamber of Commerce under file number 41055629.
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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