Re: [R] expression() - Superscript in y-axis, keeping line break in string

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sat 05 Aug 2006 - 02:04:45 EST

Use atop:

   plot(1, main = expression(atop(" "^14*C*"-glyphosate line", "line2")))

On 8/4/06, Andrew Kniss <akniss@uwyo.edu> wrote:
> I've tried several different ways to accomplish this, but as yet to no
> avail. My y-axis for a plot has a rather long label, and thus I have
> been using "/n" to break it into two lines. However, to make it
> technically correct for publication, I also need to use superscript in
> the label. For example:
>
> par(oma=c(0,0,2,0),mar=c(5,6,0.25,2),lheight=1)
> plot(1:10,
> ylab="14C-glyphosate line1\n line2")
>
> will provide the text in two lines as I would like it. However, I am
> trying to keep those same line breaks when using expression() to get my
> superscript number. This will not work, as it aligns the "14C" section
> with the bottom line of the expression making little sense to the
> reader.
>
> par(oma=c(0,0,2,0),mar=c(5,6,0.25,2),lheight=1)
> plot(1:10,
> ylab=expression(" "^14*C*"-glyphosate line1\n line2"))
>
> Is there a way to align the "14C" portion of the expression with the top
> line of the string rather than the bottom line? Any suggestions are
> greatly appreciated.
> Andrew
>
>
> --
> Andrew Kniss
> Assistant Research Scientist
> University of Wyoming
> Department of Plant Sciences
>
> akniss@uwyo.edu
> Office: (307) 766-3949
> Fax: (307) 766-5549
>
> ______________________________________________
> R-help@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.
>



R-help@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. Received on Sat Aug 05 02:12:00 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 05 Aug 2006 - 04:17:30 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.