[R] DOT PLOT help!!

MacQueen, Don macqueen1 at llnl.gov
Mon Nov 24 18:52:03 CET 2014

This example (five groups instead of your two) may be close to what you
are looking for:

  plot( rep(1:5, 20), rnorm(100))

Hopefully the ³trick² is self-evident.

(R-help doesn¹t pass on most attachments, so I can¹t look at your example)

To improve the labels I would do something like this:

  plot( rep(1:5, 20), rnorm(100), xaxt='n')
  axis(1, at=1:5, labels=letters[1:5])

The help pages you will want to look at include

If you haven¹t already, look at the Graphical Procedures section of the
R-intro manual that you can download from CRAN.

There is a more advanced function called ³dotchart² that creates dotplots.
It is nice if you can figure out how to use it. When I tried it, it
insisted on being fancier than what I assume you¹re looking for. I think
the above, which uses base graphics tools, is easier.

Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550

On 11/24/14, 1:08 AM, "Juan Scheun" <jscheun at zoology.up.ac.za> wrote:

>Morning everyone
>I am relatively new to R and although there are tons of "how to" websites,
>some are just way over my head. I am currently trying to figure out how to
>create dot plot graphs with my data, where I have categories (i.e male
>/female) and values for each. I would like to display this as categories
>on the x axis and all values for each directly above the applicable
>category, thus not a scatter graph but in a line above for each.
>I have attached a quick picture I found on the internet to demonstrate
>roughly what I would like.
>Thank you all for your time
>Juan Scheun
>Department of Zoology and Entomology
>University of Pretoria
>Lynnwood Road
>South Africa
>Cell: +27 76 860 3315
>Email: jscheun at zoology.up.ac.za
>This message and attachments are subject to a disclaimer. Please refer to
>http://www.it.up.ac.za/documentation/governance/disclaimer/ for full
>details. / Hierdie boodskap en aanhangsels is aan 'n vrywaringsklousule
>onderhewig. Volledige besonderhede is by
>http://www.it.up.ac.za/documentation/governance/disclaimer/ beskikbaar.

More information about the R-help mailing list