[R] How to adjust legend in a plot?

Manish Gupta mandecent.gupta at gmail.com
Fri Aug 3 06:09:09 CEST 2012


Hi,

I am working on bar plot and legend  overlap plot. I attempted all position
like topright, bottomright, topleft and bottomleft still same pblm is there.

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,axes = FALSE)
legend("topright", c("legend1","legend2"), cex=1.5, bty="n", fill =
c(rgb(.059, .412, .659),rgb(.537, .769, .933)));

http://r.789695.n4.nabble.com/file/n4638995/Screenshot.png  

How can i avoid overlapping of bars and legend?

Regards




--
View this message in context: http://r.789695.n4.nabble.com/How-to-adjust-legend-in-a-plot-tp4638995.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list