This might be easy to solve, but I did not find anything with google, maybe because the is hard to put into words. When running the following code
Dat<-matrix(c(1:10, 1:10, seq(0.1, 1, 0.1)), 10, 3)
par(mfrow=c(1, 2))
plot(Dat[,1], Dat[,2], ylab="Y", xlab=expression(paste("A unit (", m^2, ")", sep="")))
plot(Dat[,1], Dat[,3], ylab="Y", xlab="A unit")
I get a nice plot, but the x-axis labels are not on the same baseline. The reason is that the label of the left plot has a parentheses that reaches below the baseline of the text, and R is plotting labels such that the lowest point of the text string is taken as the baseline when using expression()
in the xlab-command. Hence the "A unit" in the right plot is printed further down than in the left plot (see example image, indicated by red line). That is annoying if some of the labels have parentheses or letters with parts that reach below the baseline (like "g", "q", etc.) and others don't. Is there any way to fix that?