combine mathematical expressions with plain text

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

combine mathematical expressions with plain text

squall44
Hello,

I would like to create a mtext. The argument 'text' should combine the mathematical expressions 'bar' with the plain text ' = 3.07'. Is that possible?

mtext(text=expression(bar(x)) ...)
' = 3.07'

Thanks for any ideas
Tobias
Reply | Threaded
Open this post in threaded view
|

Re: combine mathematical expressions with plain text

Scionforbai
plot(0,0,"n")
mtext( expression( bar(x) == 3.07) )

but you can also simply 'paste' things:

text(0,0,labels=expression(paste(bar(omega), " = 1")),srt=90)

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: combine mathematical expressions with plain text

Fernando Mayer
In reply to this post by squall44
Hi,

have you tried:

mtext(expression(bar(x) == 3.07), ...)

or

mtext(bquote(bar(x) == 3.07), ...)

?

Fernando Mayer.

squall44 escreveu:

> Hello,
>
> I would like to create a mtext. The argument 'text' should combine the
> mathematical expressions 'bar' with the plain text ' = 3.07'. Is that
> possible?
>
> mtext(text=expression(bar(x)) ...)
> ' = 3.07'
>
> Thanks for any ideas
> Tobias

______________________________________________
[hidden email] 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.