[R] Change the scale on a barplot's y axis

Thomas Levine thomas.levine at gmail.com
Sun Feb 28 01:44:29 CET 2010

I have grades data. I read them from a csv in letter-grade format. I
then converted them to levels


And then to numbers

levels(grades$gp)=c(4.3,4.0,3.7, 3.3,3.0,2.7, 2.3,2.0,1.7, 1.3,1.0,0.7)

And I'm plotting them in a barplot

barplot(gp[order(gp)],width=n[order(gp)],ylab="Class Median
Grade",xlab="Class, scaled to number of students in the
class",main="Class Median Grades for Cornell University weighted by
class size")

I would like to change the scale on the bar graph such that it reads


in the locations

c(4.3,4.0,3.7, 3.3,3.0,2.7, 2.3,2.0,1.7, 1.3,1.0,0.7)

Any ideas?


More information about the R-help mailing list