Re: [R] how to add notes to the graph?

From: Dieter Menne <dieter.menne_at_menne-biomed.de>
Date: Mon, 28 Jul 2008 15:54:02 +0000 (UTC)

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



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. Received on Mon 28 Jul 2008 - 16:01:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 28 Jul 2008 - 16:32:36 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive