Quantcast

placing a text in the corner of a plot

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

placing a text in the corner of a plot

Jörg Groß
Is there an easy way to add a text into an R-plot and place it in the  
upper left corner?

Like that:


--------------------------------
|  (a)                                  |
|                                         |
|                                         |
|                                         |
|                                         |
|                                         |
--------------------------------

The (a) should be at the borders of a box defined by the box()-command.

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

Re: placing a text in the corner of a plot

Jorge I Velez
Dear Jörg,

Perhaps,

plot(1:10)
legend("topleft",c("Your text here"),pch=1)

See ?legend and ?text for more information.

HTH,

Jorge


On Tue, Jul 29, 2008 at 6:04 PM, Jörg Groß <[hidden email]> wrote:

> Is there an easy way to add a text into an R-plot and place it in the upper
> left corner?
>
> Like that:
>
>
> --------------------------------
> |  (a)                                  |
> |                                         |
> |                                         |
> |                                         |
> |                                         |
> |                                         |
> --------------------------------
>
> The (a) should be at the borders of a box defined by the box()-command.
>
> ______________________________________________
> [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

Re: placing a text in the corner of a plot

Jörg Groß
> legend("topleft",c("Your text here"),pch=1)


Thanks!

But is it possible to get rid of the legend-box and the box-shadow?

I don't find an argument in the manual for that.



Am 30.07.2008 um 00:08 schrieb Jorge Ivan Velez:

>
> Dear Jörg,
>
> Perhaps,
>
> plot(1:10)
> legend("topleft",c("Your text here"),pch=1)
>
> See ?legend and ?text for more information.
>
> HTH,
>
> Jorge
>
>
> On Tue, Jul 29, 2008 at 6:04 PM, Jörg Groß <[hidden email]>  
> wrote:
> Is there an easy way to add a text into an R-plot and place it in  
> the upper left corner?
>
> Like that:
>
>
> --------------------------------
> |  (a)                                  |
> |                                         |
> |                                         |
> |                                         |
> |                                         |
> |                                         |
> --------------------------------
>
> The (a) should be at the borders of a box defined by the box()-
> command.
>
> ______________________________________________
> [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

Re: placing a text in the corner of a plot

Rolf Turner

On 30/07/2008, at 10:47 AM, Jörg Groß wrote:

>> legend("topleft",c("Your text here"),pch=1)
>
>
> Thanks!
>
> But is it possible to get rid of the legend-box and the box-shadow?
>
> I don't find an argument in the manual for that.

        You explicitly said that you *wanted* a box!!!

        But be that as it may, you can eliminate the box
        by putting ``bty="n"'' in the call to legend.

        I have no idea what you mean by ``box-shadow''.

<snip>

        cheers,

                Rolf Turner
######################################################################
Attention:
This e-mail message is privileged and confidential. If you are not the
intended recipient please delete the message and notify the sender.
Any views or opinions presented are solely those of the author.

This e-mail has been scanned and cleared by MailMarshal
www.marshalsoftware.com
######################################################################

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

Re: placing a text in the corner of a plot

Ben Tupper
In reply to this post by Jörg Groß

On Jul 29, 2008, at 6:47 PM, Jörg Groß wrote:

>> legend("topleft",c("Your text here"),pch=1)
>
>
> Thanks!
>
> But is it possible to get rid of the legend-box and the box-shadow?
>
> I don't find an argument in the manual for that.
>

Hi,

The documentation for the argument is right there - but as always it  
is finding it that is the trick.

Try this...

legend("topleft",c("Your text here"),pch=1, box.lty = 0)


Cheers,
Ben


>
>
> Am 30.07.2008 um 00:08 schrieb Jorge Ivan Velez:
>
>>
>> Dear Jörg,
>>
>> Perhaps,
>>
>> plot(1:10)
>> legend("topleft",c("Your text here"),pch=1)
>>
>> See ?legend and ?text for more information.
>>
>> HTH,
>>
>> Jorge
>>
>>
>> On Tue, Jul 29, 2008 at 6:04 PM, Jörg Groß <[hidden email]>
>> wrote:
>> Is there an easy way to add a text into an R-plot and place it in
>> the upper left corner?
>>
>> Like that:
>>
>>
>> --------------------------------
>> |  (a)                                  |
>> |                                         |
>> |                                         |
>> |                                         |
>> |                                         |
>> |                                         |
>> --------------------------------
>>
>> The (a) should be at the borders of a box defined by the box()-
>> command.
>>
>> ______________________________________________
>> [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.

Ben Tupper
[hidden email]

I GoodSearch for Ashwood Waldorf School.

Raise money for your favorite charity or school just by searching the  
Internet with GoodSearch - www.goodsearch.com - powered by Yahoo!

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

Re: placing a text in the corner of a plot

Jim Lemon
In reply to this post by Jörg Groß
On Wed, 2008-07-30 at 00:04 +0200, Jörg Groß wrote:

> Is there an easy way to add a text into an R-plot and place it in the  
> upper left corner?
>
> Like that:
>
>
> --------------------------------
> |  (a)                                  |
> |                                         |
> |                                         |
> |                                         |
> |                                         |
> |                                         |
> --------------------------------
>
> The (a) should be at the borders of a box defined by the box()-command.
>
Hi Jorg,
Maybe the corner.label function in plotrix will do what you want.

Jim

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