You could use the xlim argument to barplot.  For example,

barplot(t(data[,2:3]), beside=TRUE, xlim=c(0, 20), 
        col=c(rgb(.537, .769, .933), rgb(.059, .412, .659)), 
        width=1, horiz=TRUE, cex.names=.9, border ="white", 
        las=1, cex.axis=1, cex.lab=1.2)

Jean


Manish Gupta <mandecent.gu...@gmail.com> wrote on 08/01/2012 02:38:42 AM:
> 
> Hi,
> 
> I am working on barplot.  I need to plot x-axis but scale on x axis is 
very
> upto 15 while my data is upto 19.
> 
> pdf("image.pdf", width=10 , height =13)
> par(mar=c(5,22.5,2,2))
> barplot(t(data[,2:3]),   beside=TRUE, col=c(rgb(.537, .769, 
.933),rgb(.059,
> .412, .659)), width = 1, horiz=TRUE,cex.names=.9, border ="white",las=1,
> cex.axis= 1, cex.lab=1.2)
> legend("topright", c("X","Y"), cex=1.5, bty="n", fill = c(rgb(.059, 
.412,
> .659),rgb(.537, .769, .933)));
> abline(v = 0, lwd = 1, col = 1)
> dev.off()
> 
> http://r.789695.n4.nabble.com/file/n4638634/Screenshot.png 
> 
> How can i stretch x axis upto max input value?

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to