[R] How to create axis y axis for horizontal bar plot?

Robert Baer rbaer at atsu.edu
Fri May 18 15:05:47 CEST 2012


-----Original Message----- 
From: Manish Gupta
Sent: Friday, May 18, 2012 2:52 AM
To: r-help at r-project.org
Subject: [R] How to create axis y axis for horizontal bar plot?

Hi,

i am working on bar plot but i need to generate y axis for horizontal bar
plot.  In the attached diagram x-axis is there with scale 0 to 12 but i need
y axis.  How can i implement it?

http://r.789695.n4.nabble.com/file/n4630478/barplot2.jpg

Thanks

Try:
gears = c(3,4,5)
b = barplot(gears, horiz=TRUE)
axis(2, at=b, labels=c('three','four','five'))

Rob
------------------------------------------
Robert W. Baer, Ph.D.
Professor of Physiology
Kirksville College of Osteopathic Medicine
A. T. Still University of Health Sciences
800 W. Jefferson St.
Kirksville, MO 63501
660-626-2322
FAX 660-626-2965 



More information about the R-help mailing list