Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase size of boxplot names in R

I'm having issues in locating an answer for this, as I don't want to increase the size of the x-axis label, but the names attribute of my boxplot.

I am generating a 1x3 subplot, with 3 boxes shown within each boxplot.

data1 = c(d1, d3, d3)
data2 = c(e1, e2, e3)
data3 = c(f1, f2, f3)
lbls = c("Label 1", "Label 2", "Label 3")
par(mfrow=c(1,3))
boxplot(data1, names=lbls, ylab="Components", main="First Plot", ylim=c(0,1500))
boxplot(data2, names=lbls, ylab="Components", main="Second Plot", ylim=c(0,1500))
boxplot(data3, names=lbls, ylab="Components", main="Third Plot", ylim=c(0,1500))

I have tried playing around with things like par(cex.lab=1.5), boxplot(..., label.cex=1.5), and so on, but nothing actually increases the size of the names field, only the label axes.

like image 488
the_e Avatar asked May 07 '12 19:05

the_e


1 Answers

Using the par() command with the appropriate command will allow you to resize it.

Try using one of the two following commands with varying sizes and it should work out for you.

par(cex.lab=1.5) # is for y-axis

par(cex.axis=1.5) # is for x-axis
like image 125
Swiftfoottim Avatar answered Sep 18 '22 15:09

Swiftfoottim