Re: [R] strange behavior of plotmath

2018-05-21 Thread S Ellison
> plot(1:10, xlab = expression(NO[3]^-~(mg/L))) It's unexpected but not inexplicable. The difficulty is that the superscript begins with a unary minus operator. It _must_ have something (number or variable) after it to negate. Since the thing following the '-' is not a number, plotmath has just t

Re: [R] strange behavior of plotmath

2018-05-21 Thread Rui Barradas
Try plot(1:10, xlab = expression(NO[3]^{'-'}~(mg/L))) Hope this helps, Rui Barradas On 5/21/2018 1:09 PM, Jinsong Zhao wrote: hi there, I find the following codes produce strange output. plot(1:10, xlab = expression(NO[3]^-~(mg/L))) you will notice that the unit, mg/L is in superscript for

Re: [R] strange behavior of plotmath

2018-05-21 Thread Eric Berger
FYI I see everything after the '^' as a superscript. The '~' does act as a space. (When I omit it there is less space between the '-' and the '('. On Mon, May 21, 2018 at 3:09 PM, Jinsong Zhao wrote: > hi there, > > I find the following codes produce strange output. > > plot(1:10, xlab = expre

[R] strange behavior of plotmath

2018-05-21 Thread Jinsong Zhao
hi there, I find the following codes produce strange output. plot(1:10, xlab = expression(NO[3]^-~(mg/L))) you will notice that the unit, mg/L is in superscript format. That means that "~" is not for space. However, the help page of plotmath does not mention this behavior. Best, Jinsong