[R] mtext in barplot

Jim Lemon jim at bitwrit.com.au
Mon Apr 6 11:20:48 CEST 2009


johnhj wrote:
> Hii,
>
> Can anybody help me to put a text under the barplots. I will describe the
> percental between six grouped barplots. I tried to do it with mtext but
> without success.
>
> ...
> I tired to do it with 
> mtext(side=1,at=x, text =c("Mean", "","","","","rere"), col = "red"),
> line = 1, cex = 0.75) but without success, I get this example from a R
> tutorial...
>   
Hi John,
The horizontal bar positions are returned invisibly by the barplot 
function, so:

xpos<-barplot(...)
mtext(side=1,at=xpos,...)

should do what you want.

Jim




More information about the R-help mailing list