Quantcast

Using expression() in plot() XXXX

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Using expression() in plot() XXXX

Dan Abner
Hello everyone,

I am trying to add the following text (in proper notation) to a
graphic using expression().

X-bar (with a subscript of cv) = XX.

Note: Ideally "cv" would be a subscript, but it doesn't have to be.

 I have the following code:


> text(625,.012,expression(bar(X)cv = 552.01))
Error: unexpected symbol in "text(625,.012,expression(bar(X)cv"

I have also tried the following:

> text(625,.012,paste(as.character(expression(bar(X))),"cv = 552.01",sep=""))
>

While I get no error message for the later, it actually prints

bar(X)

instead of resolving to the proper notation.

Any assistance is appreciated.

Thanks!

Dan

______________________________________________
[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
|  
Report Content as Inappropriate
star

Re: Using expression() in plot() XXXX

Jorge I Velez
Hi Dan,

If I understood correctly, the following will do:

plot(0, main = expression(bar(X)^{cv}))

HTH,
Jorge.-


On Mon, May 7, 2012 at 5:39 PM, Dan Abner <> wrote:

> Hello everyone,
>
> I am trying to add the following text (in proper notation) to a
> graphic using expression().
>
> X-bar (with a subscript of cv) = XX.
>
> Note: Ideally "cv" would be a subscript, but it doesn't have to be.
>
>  I have the following code:
>
>
> > text(625,.012,expression(bar(X)cv = 552.01))
> Error: unexpected symbol in "text(625,.012,expression(bar(X)cv"
>
> I have also tried the following:
>
> > text(625,.012,paste(as.character(expression(bar(X))),"cv =
> 552.01",sep=""))
> >
>
> While I get no error message for the later, it actually prints
>
> bar(X)
>
> instead of resolving to the proper notation.
>
> Any assistance is appreciated.
>
> Thanks!
>
> Dan
>
> ______________________________________________
> [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.
>

        [[alternative HTML version deleted]]

______________________________________________
[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
|  
Report Content as Inappropriate
star

Re: Using expression() in plot() XXXX

Jorge I Velez
The code below should have been

plot(0, main = expression(bar(X)[cv]))

Apologies for the noise.
Jorge.-


On Mon, May 7, 2012 at 5:44 PM, Jorge I Velez <> wrote:

> Hi Dan,
>
> If I understood correctly, the following will do:
>
> plot(0, main = expression(bar(X)^{cv}))
>
> HTH,
> Jorge.-
>
>
>
> On Mon, May 7, 2012 at 5:39 PM, Dan Abner <> wrote:
>
>> Hello everyone,
>>
>> I am trying to add the following text (in proper notation) to a
>> graphic using expression().
>>
>> X-bar (with a subscript of cv) = XX.
>>
>> Note: Ideally "cv" would be a subscript, but it doesn't have to be.
>>
>>  I have the following code:
>>
>>
>> > text(625,.012,expression(bar(X)cv = 552.01))
>> Error: unexpected symbol in "text(625,.012,expression(bar(X)cv"
>>
>> I have also tried the following:
>>
>> > text(625,.012,paste(as.character(expression(bar(X))),"cv =
>> 552.01",sep=""))
>> >
>>
>> While I get no error message for the later, it actually prints
>>
>> bar(X)
>>
>> instead of resolving to the proper notation.
>>
>> Any assistance is appreciated.
>>
>> Thanks!
>>
>> Dan
>>
>> ______________________________________________
>> [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.
>>
>
>

        [[alternative HTML version deleted]]

______________________________________________
[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
|  
Report Content as Inappropriate
star

Re: Using expression() in plot() XXXX

Rui Barradas
In reply to this post by Dan Abner
Hello,

Try

plot(1)
text(1, 1.4, expression(bar(X)[cv] == 552.01))

 [subscript] and  ==

Hope this helps,

Rui Barradas

Dan Abner wrote
Hello everyone,

I am trying to add the following text (in proper notation) to a
graphic using expression().

X-bar (with a subscript of cv) = XX.

Note: Ideally "cv" would be a subscript, but it doesn't have to be.

 I have the following code:


> text(625,.012,expression(bar(X)cv = 552.01))
Error: unexpected symbol in "text(625,.012,expression(bar(X)cv"

I have also tried the following:

> text(625,.012,paste(as.character(expression(bar(X))),"cv = 552.01",sep=""))
>

While I get no error message for the later, it actually prints

bar(X)

instead of resolving to the proper notation.

Any assistance is appreciated.

Thanks!

Dan

______________________________________________
[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
|  
Report Content as Inappropriate
star

Re: Using expression() in plot() XXXX

Rolf Turner-3
In reply to this post by Dan Abner

The following works for me:

     plot(1:10)
     text(4,8,expression(bar(X)[cv]==552.01))

     cheers,

         Rolf Turner

On 08/05/12 09:39, Dan Abner wrote:

> Hello everyone,
>
> I am trying to add the following text (in proper notation) to a
> graphic using expression().
>
> X-bar (with a subscript of cv) = XX.
>
> Note: Ideally "cv" would be a subscript, but it doesn't have to be.
>
>   I have the following code:
>
>
>> text(625,.012,expression(bar(X)cv = 552.01))
> Error: unexpected symbol in "text(625,.012,expression(bar(X)cv"
>
> I have also tried the following:
>
>> text(625,.012,paste(as.character(expression(bar(X))),"cv = 552.01",sep=""))
>>
> While I get no error message for the later, it actually prints
>
> bar(X)
>
> instead of resolving to the proper notation.
>
> Any assistance is appreciated.
>
> Thanks!
>
> Dan
>
> ______________________________________________
> [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.
>

______________________________________________
[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.
Loading...