ana1$B<-factor(ana1$Burn,c("C","N","L","S"))
with(ana1,boxplot(Time~ana1$B, ylab = "Infiltration Rate (mm/h) " , xlab ="Burn Treatment", las = 2, par(mar = c(12, 5, 4, 2)+0.1), names = c( "Control" , "Not burned since 1954" , "Long rotation burn" , "Short rotation burn" ) ) )
Hi, this is my current code, which creates axis titles that are obstructed by my rotated labels. Does any one know how to move both of the axis titles across and down?
I am really struggling with this, although the solution may be very easy!
So I have alerted the code, however now the x axis label has gone off the box plot entirely
ana1$B<-factor(ana1$Burn,c("C","N","L","S"))
with(ana1,boxplot(Time~ana1$B, ylab = "Infiltration Rate (mm/h) " , xlab = "", las = 2, par(mar = c(12, 4, 4, 1)+0.1), title("Burn Treatment", line = 10), names = c( "Control" , "Not burned since 1954" , "Long rotation burn" , "Short rotation burn" ) ) )
The parameter has changed but the x axis label has disappeared
You can use
title
to manually draw an axis title, and adjust its position through theline
parameter. For example, for the x axis, you can doYou can increase the plot margin using
par(mar = ...)
. You'll probably need to tweak the parameterspar(mar = ...)
andtitle(..., line = ...)
for your data.Sample data
Update
The following should work with your data:
You might have to play around with
line = 10
and try different values; ditto for the plot margins. The first number inmar = c(12, 4, 4, 2)
gives the bottom margin, see?par
for details.