[R] Text Labels on plots in R

ggrothendieck@yifan.net ggrothendieck at yifan.net
Wed Apr 3 17:10:58 CEST 2002


Suppose

y <- c(5:2,4)
names(y) <- c("Dave", "Tim", "Ian", "Steve", "Paul")

Here are 3 possibilities which are close to what you want:

dotchart(y)            <-- axes are switched from what you specified
plot(as.table(y))   <-- uses vertical bars rather than points
plot( y ~ factor(names(y),levels=names(y)), boxwex = .05)  <-- not so pretty



On 3 Apr 2002 at 11:26, Danny Ruttle wrote:

> Hi
> 
> Is it possible to plot values against strings, i.e. the x axis has people's 
> names and the
> y axis as values, as shown below:
> 
> 
> 5    x
> 4             x                         x
> 3                     x
> 2                               x
> 1
> 0
>      Dave  Tim    Ian   Steve  Paul
> 
> Sorry if this is a little primitive, but I think it gets the point across.
> 
> regards
> Danny
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list