It would be useful to have more information and a reproducible example.
For instance :
1. Why such margin at the left side ?
2. Why do you have the same problem when you plot the legend at the
bottom ? Have you tried to define the exact (x,y) location ?
3. Why do you say cex doesn't affect you x-labels ?
> 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.
These are not all positions. Tried to define the exact location (x,y)
> 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)));
What is "data". Please provide a fully reproducible example.
> No, My X label are so big so i cannot reduce margin and cex change won't
> affect it much. Is there any way to write legend first and start plot
What are your x-labels ? Why cex doesn't affect it ? Please provide the
code you used.
> I cannot reduce bar width. It is ok for me. Is there any way to merge two
> plots one with only legend and other with barplot?
Yes you can plot your graph and the legend in 2 different plot using
#plot first graph
but the overall size of the graph would be smaller and you just said you
don't want to reduce the bar width....
We cannot help you without a fully reproducible example and explanations
of the (very picky) limitations you want.