Quantcast

How to label specific points on a scatterplot

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

How to label specific points on a scatterplot

rstudent
Command I am using for the plot:

plot(Raw[][Plate==101]~well[][Plate==101], xlab="Well", ylab="Raw", main="Plate 101")

I only want to label points on the graph where well equals B13, G13, K14 and N14 with the name of the well.

Thank you for your help.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: How to label specific points on a scatterplot

David Winsemius

On Jul 8, 2011, at 1:31 PM, rstudent wrote:

> Command I am using for the plot:
>
> plot(Raw[][Plate==101]~well[][Plate==101], xlab="Well", ylab="Raw",
> main="Plate 101")
>
> I only want to label points on the graph where well equals B13, G13,  
> K14 and
> N14 with the name of the well.

?"%in%"
?text


>
> Thank you for your help.
>
> --
> View this message in context: http://r.789695.n4.nabble.com/How-to-label-specific-points-on-a-scatterplot-tp3654697p3654697.html
> Sent from the R help mailing list archive at Nabble.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.

David Winsemius, MD
West Hartford, CT

______________________________________________
[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: How to label specific points on a scatterplot

rstudent
I can use the text() command to label all points but how do you specify only to label those four specific points on the graph?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: How to label specific points on a scatterplot

David Winsemius

On Jul 8, 2011, at 2:02 PM, rstudent wrote:

> I can use the text() command to label all points but how do you  
> specify only
> to label those four specific points on the graph?
>

No context, no example, evidence that you read the rest of my message,  
no further response.

> --
> View this message in context: http://r.789695.n4.nabble.com/How-to-label-specific-points-on-a-scatterplot-tp3654697p3654777.html
> Sent from the R help mailing list archive at Nabble.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.

David Winsemius, MD
West Hartford, CT

______________________________________________
[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: How to label specific points on a scatterplot

rstudent
I have only been using R for a very short time and I'm trying to learn.

What information do you need to help me?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: How to label specific points on a scatterplot

VictorDelgado
In reply to this post by rstudent
rstudent,

one solution could be given by spliting your graph in two parts:

part_1 <- # take the desired four points subset #
part_2 <- # all rest points not to label

You will also need one vector with your names. I supose:

list <- c("B13", "G13", "K14", "N14")

So

plot(part_1$x, part_1$y)
text(part_1$x, part_1$y+.1, list)
points(part_2$x, part_2$y)

Maybe you will have to set the limits (xlim and ylim) of your graph and chage .1 to a more precise value.
Please, take care and ensure carefully reading of command internal help (typing ?text, for example), the R's help-pages are very clear and didactic.

Be sure also, searching for previous questions already made in "r-help", preventing double questions on basic isues, and be more specific possible about your problem. If your data is from base, I could give you one better answer.

Take care, Have a god job!

Victor Delgado
cedeplar.ufmg.br P.H.D. student
www.fjp.mg.gov.br reseacher
Victor Delgado cedeplar.ufmg.br P.H.D. student UFOP assistant professor
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: How to label specific points on a scatterplot

David Winsemius
In reply to this post by rstudent

On Jul 8, 2011, at 2:53 PM, rstudent wrote:

> I have only been using R for a very short time and I'm trying to  
> learn.
>
> What information do you need to help me?

As it says at the bottom of every message to Rhelp:

" read the posting guide http://www.R-project.org/posting-guide.html "

>
> --
> View this message in context: http://r.789695.n4.nabble.com/How-to-label-specific-points-on-a-scatterplot-tp3654697p3654903.html
> Sent from the R help mailing list archive at Nabble.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.

David Winsemius, MD
West Hartford, CT

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