[R] boxplot names italic

Jim Lemon jim at bitwrit.com.au
Tue Sep 25 12:19:36 CEST 2012


On 09/25/2012 06:08 PM, Wolf Sarah wrote:
> Hello
>
> I have two boxplots and want the names to be in italic, which works fine, except that the second name (Sinapis) is raised, compared to the first name:
>
> bicran<-c(0.55,0.25,0.6,0.83,0.11,0,0.67,1.36,0.9,1.09)
> bicsin<-c(0.09,0.53,0.45,0.38,1.18,0.45,0.78,1.17,1.22,1.4)
> ran.text<-expression(italic(Ranunculus))
> sin.text<-expression(italic(Sinapis))
> boxplot(bicran, bicsin, names=c(ran.text, sin.text))
> mtext("(N=10)", side=1,line=1, adj=0.43,cex=0.9)
> mtext("(N=10)",side=1,line=1,adj=0.9, cex=0.9)
>
>
> Is there anything I can do against that? With the names in regular letters there is no problem, the names show up on the same level:
>
> boxplot(bicran, bicsin, names=c("Ranunculus", "Sinapis"))
>
Hi Sarah,
Try this:

boxplot(bicran, bicsin, names=c("",""))
mtext(c(ran.text,sin.text),at=1:2,line=c(0.9,1),side=1)

That looks about right, but you can fiddle with it.

Jim




More information about the R-help mailing list