# How to create axis y axis for horizontal bar plot?

5 messages
Open this post in threaded view
|
Report Content as Inappropriate

## 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? Thanks
Open this post in threaded view
|
Report Content as Inappropriate

## Re: How to create axis y axis for horizontal bar plot?

 -----Original Message----- From: Manish Gupta Sent: Friday, May 18, 2012 2:52 AM To: [hidden email] 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.jpgThanks 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 ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: How to create axis y axis for horizontal bar plot?

 In reply to this post by Manish Gupta # Hi Manish, try this # locate the y axis central positions barObj <- plot(factor(mtcars\$gear, labels = paste(3:5, "Gears")), horiz = TRUE) # create the plot plot(factor(mtcars\$gear, labels = paste(3:5, "Gears")), horiz = TRUE) # add axes axis(side = 2, at = c(barObj), labels = FALSE) Chris Campbell   Tel. +44 (0) 1249 705 450 http://www.mango-solutions.comMango Solutions 2 Methuen Park Chippenham Wiltshire SN14 OGB UK -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Manish Gupta Sent: 18 May 2012 08:53 To: [hidden email] 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 -- View this message in context: http://r.789695.n4.nabble.com/How-to-create-axis-y-axis-for-horizontal-bar-plot-tp4630478.htmlSent from the R help mailing list archive at Nabble.com. ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code. LEGAL NOTICE This message is intended for the use o...{{dropped:10}} ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: How to create axis y axis for horizontal bar plot?

 In reply to this post by Robert Baer Thanks! It works but how can i remove x axis? Regards