0
votes

I am producing a conditioning plot in R and would like the font sizes on the axis labels, the axis titles and the main title to be larger, so that it is more readable when I put the plot in a document. I have tried the usual cex.lab font.lab etc. but note that the R documentation for coplot states 'The rendering of arguments xlab and ylab is not controlled by par arguments cex.lab and font.lab even though they are plotted by mtext rather than title.'

Some dummy data and the code I have used to produce the plot is pasted below.

c <- c(12, 10, 11, 23, 16, 14, 13, 9, 10)
b <- c(1.23, 1.45, 1.67, 1.76, 1.83, 1.12, 1.43, 1.23, 1.21)
a <- c(13, 15, 16, 22, 23, 26, 31, 19, 25)
coplot(c ~ a | b,number=4, xlab = "a",
   ylab='c', main='Given: b',
   panel = function(x,y,...) {
     points(x,y, pch=4, cex=1.5)
     abline(lm(y ~ x), col='blue', lwd=1.5) 
     abline(lm(WIT ~ age), col='green', lwd=1.5) })

Any suggestions on how to increase the font sizes here greatly appreciated. Thanks very much.

1
It is easier to help you if you provide some toy data and thus code that runs. And you also get better answers.Anders Ellern Bilgrau
Thanks for the comment, some toy data added now.Sam Maule

1 Answers

0
votes

I am not sure I understand the documentation. Regardless of what it says, using the cex.lab in par() does seem to work at my end:

par(cex.lab = 3)  # Default is 1
coplot(WIT ~ age | log(height),
       number=4, 
       xlab = "Age (years)",
       ylab=expression(paste('WIT'[1],' (litres)')), 
       main='Given: Log(height)',
       panel = function(x,y,...) {
         points(x,y, pch=4, cex=1.5)
         abline(lm(y ~ x), col='blue', lwd=1.5) 
        abline(lm(WIT ~ age), col='green', lwd=1.5) }
       )

That also makes sense if you look at the source of the coplot function (seen by running coplot).