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

Chris Campbell ccampbell at mango-solutions.com
Fri May 18 15:45:04 CEST 2012


# 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.com
Mango Solutions
2 Methuen Park
Chippenham
Wiltshire 
SN14 OGB
UK
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Manish Gupta
Sent: 18 May 2012 08:53
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

--
View this message in context: http://r.789695.n4.nabble.com/How-to-create-axis-y-axis-for-horizontal-bar-plot-tp4630478.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
LEGAL NOTICE
This message is intended for the use o...{{dropped:10}}



More information about the R-help mailing list