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