Skip to content
Prev 275247 / 398503 Next

how to plot a distribution of mean and standard deviation

R. Michael Weylandt <michael.weylandt <at> gmail.com> writes:
[snip]
[snip]


  You could make a "caterpillar plot" as follows:

X <- read.csv("coursetmp.dat")
library(ggplot2)
X <- transform(X,courseid=reorder(courseid,average))
ggplot(X,aes(x=courseid,y=average,
   ymin=average-2*std,ymax=average+2*std))+geom_point()+
  geom_linerange()+coord_flip()

  (Here the x and y axes are flipped because it's easier to plot & read
the course ID labels that way)

  Of course, the answer to "how should I visualize these data?" always
depends on what you want to find out ...