You could use something like this:

#Generate 26 simulated data points

y=rnorm(26)
x=1:26
your.labels=letters
#Plot data

plot(x, y, xlim=c(min(x), max(x)+.25), ylim=c(min(y), max(y)+.25))
#Label points

text(x+.15, y+.15, your.labels)



You could also use the textxy function in the calibrate package as show here:  
http://www.r-bloggers.com/r-tutorial-series-labeling-data-points-on-a-plot/.



________________________________
 From: john55 <johannes...@gmail.com>
To: r-help@r-project.org 
Sent: Saturday, November 24, 2012 11:04 AM
Subject: [R] How to Label Cases in Scatterplots?

Hi everyone,

i´m trying to graphically display distributions with r and i´m working with
makrodata from the WVS.

the command i´m using is
                                                      
> plot (Makrodata$v11, Makrodata$v12, xlab="Democracy Score Economist",
> ylab= share religious people")


i´m having an additional variable that identifies respectively labels the
cases with its country name.
how can i implement that variable, so it identifies the various cases in the
scatterplot and looks like the spss screenshot i posted below?

<http://r.789695.n4.nabble.com/file/n4650650/Unbenannt.gif> 

thanks in advance!



--
View this message in context: 
http://r.789695.n4.nabble.com/How-to-Label-Cases-in-Scatterplots-tp4650650.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@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.
        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to