You successfully used an 'expression' object in your first example
plot(1,1,xlab=expression(paste("D50 [", mu,"m]")))
so use a vector of expressions in your second example
nams<-c(expression(P[205]~"[%]"), expression(paste("D50 [", mu, "m]")))
par(mfrow=c(2,1))
for (i in 1:2) plot(1, 1,
M. Heiberger; S Ellison
> Cc: r-help@r-project.org
> Subject: Re: [R] lost in plotmath expressions
>
> Why don't try this?
>
> > nams<-c("P2O5 ['%']", "D50 [mu*m]")
> > pdf("test.pdf")
> > for(i in 1:2)
> + plot(1,
e.edu]
Sent: Friday, January 30, 2015 2:30 PM
To: PIKAL Petr
Cc: r-help@r-project.org
Subject: Re: [R] lost in plotmath expressions
I would do this
names <- c(expression(D[50]~mu*m), expression(P[2]*O[5]*"%")) for (i in
1:2) plot(1, 1, xlab=names[i])
On Fri, Jan 30, 2015 at 7:33 AM, P
le.edu]
> Sent: Friday, January 30, 2015 2:30 PM
> To: PIKAL Petr
> Cc: r-help@r-project.org
> Subject: Re: [R] lost in plotmath expressions
>
> I would do this
>
> names <- c(expression(D[50]~mu*m), expression(P[2]*O[5]*"%")) for (i in
> 1:2) plot(1, 1, xlab=names[
I would do this
names <- c(expression(D[50]~mu*m), expression(P[2]*O[5]*"%"))
for (i in 1:2) plot(1, 1, xlab=names[i])
On Fri, Jan 30, 2015 at 7:33 AM, PIKAL Petr wrote:
> Dear all
>
> I usually find out how I can use expressions in picture annotationmyself :-)
>
> plot(1,1, xlab=expression(past
> nams<-c("P2O5 [%]", "D50 [mum]")
These are strings; plotmath is invoked on expressions.
Also, in an expression, [] has special meaning (it's treated as a subscripted
index), so a space followed by '[' causes an error and even if that didn't
happen, [] would not give units in square brackets.
H
Dear all
I usually find out how I can use expressions in picture annotationmyself :-)
plot(1,1, xlab=expression(paste("D50 [", mu,"m]")))
However when I want to use this programmatically I am rather lost. Is there
anybody who can shed a light on such annotation?
nams<-c("P2O5 [%]", "D50 [mum]"
7 matches
Mail list logo