heights1=c(5,5,4.5,4,4,4,4.5,2,4,4)
opar <- par(lwd = 0.3)
barplot(heights1,xlim=c(0,3), ylim=c(0,5), width=0.1,
main=\"Langauges(Verbal & Non-verbal)\",
nam
Change your legend
line to
legend("topright", c("reading/Writing", "Speaking"), col=c("darkblue","red"), lwd=10);
The lwd
argument says the legend should have lines of 10 pixel thickness of each of the corresponding colors. It's a good idea to use "topright"
rather than "top"
in your case so that the legend doesn't appear under the bars.