I'm working on a paper that is to be submitted to an Elsevier journal. The official guidelines state that:

As a general rule, the lettering on the artwork should have a finished, printed size of 7 pt for normal text and no smaller than 6 pt for subscript and superscript characters.

I use the knitr + lattice + tikzDevice combination. I set the following options:

opts_chunk$set(include=FALSE, error=FALSE, warning=FALSE, echo=FALSE,
dev="tikz", dev.args=list(pointsize=10), fig.align="center")

And my plot is generated with fig.width=3.5, fig.height=3.5. I get the following result with a call to xyplot, without passing any cex option:

enter image description here

The axis labels are larger than the main text, whose normalsize is 10pt (I think---I'm using the elsarticle document class with the 3p option).

When I open one of the generated tikz files, I found several node declarations such as this one:

\node[text=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.20] at (137.00, 12.04) {Day};

It looks like tikzDevice applies a scale factor of 1.2 to the axis labels; strangely, this does not seem to be the case with graphics produced with base graphics.

Any idea why this behaviour, and what I can do to bring the size of axis labels down to the desired 7pt?


Since I posed that question I've switched to ggplot, and with that package I get the size I need by changing the base_size parameter of the theme:

theme_set(theme_bw(base_size = 7))

I haven't checked but I suspect something similar can be done with lattice.


I'm using ggplot too, but setting the base_size as lindelof proposed didn't work for me. What did the trick was explicitly setting the font size for the axis labels:

ggplot(...) + theme(axis.title = element_text(size = 10))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.