Hi, I have a simple graph: x <- c(1,2,3) plot(x, pch=16,type="b") I would like to add some notes just beside these 3 dots, and the notes are stored in a vector: a <- c(12,54,84) So the result will be: there should be a "12" below the first dot (or next to it, but not replacing the solid dot), a "54" next to the second dot... what if a is not numeric? a <- c("a","b","c") Thank you very much!! -- View this message in context: http://www.nabble.com/how-to-add-notes-to-the-graph--tp18689195p18689195.html Sent from the R help mailing list archive at Nabble.com.
rlearner309 <unixunix99 <at> gmail.com> writes:> x <- c(1,2,3) > plot(x, pch=16,type="b") > > I would like to add some notes just beside these 3 dots, and the notes are > stored in a vector: > > a <- c(12,54,84) > > So the result will be: there should be a "12" below the first dot (or next > to it, but not replacing the solid dot), a "54" next to the second dot... > > what if a is not numeric? a <- c("a","b","c")Not very general, but good as a starter: text(1:length(x),x-0.1,x) text(1:length(x),x-0.1,a) Dieter
On Mon, 2008-07-28 at 06:32 -0700, rlearner309 wrote:> Hi, > I have a simple graph: > x <- c(1,2,3) > plot(x, pch=16,type="b") > > I would like to add some notes just beside these 3 dots, and the notes are > stored in a vector: > > a <- c(12,54,84) > > So the result will be: there should be a "12" below the first dot (or next > to it, but not replacing the solid dot), a "54" next to the second dot... > > what if a is not numeric? a <- c("a","b","c")Hi rlearner309, Have a look at thigmophobe.labels in the plotrix package. Jim