I am using GNUplot in combination with the TikZ terminal by using the command 'set term TikZ standalone color solid size 3.25in,2.25in'.

The first line in .tex file that is produced when running 'gnuplot <filename>' is always \documentclass[10pt]{article}, while I need it to be 12pt.

I know I can simply change the 10pt to 12pt manually but then often locations of text labels do not look nice any more.

Thus, I want to know which command I have to denote in the GNUplot script to inherently make the fonts 12pt, so that the text labels are placed correctly by GNUplot itself.

Thanks in advance!


It's explained in the gnuplot manual, section "Lua tikz"

The <fontdesc> string may contain any valid TeX/LaTeX/ConTeXt font commands like e.g. \small. It is passed directly as a node parameter in form of "font={<fontdesc>}". This can be ’misused’ to add further code to a node, e.g. \small,yshift=1ex or ,yshift=1ex are also valid while the latter does not change the current font settings. One exception is the second argument of the list. If it is a number of the form <number>{unit} it will be interpreted as a fontsize like in other terminals and will be appended to the first argument. If the unit is omitted the value is interpreted as ’pt’. As an example the string \sffamily,12,fill=red sets the font to LaTeX’s sans serif font at a size of 12pt and red background color. The same applies to ConTeXt, e.g. \switchtobodyfont[iwona],10 changes the font to Iwona at a size of 10pt. Plain TeX users have to change the font size explicitly within the first argument. The second should be set to the same value to get proper scaling of text boxes.

So your gnuplot header should became set term tikz standalone color solid size 3.25in,2.25in font ",12".

  • Thanks a lot for the hint giordano! But unfortunately, it does not seem to work with me. I put the line you mentioned in my GNUplot exactly as it is, and it just results in the number 12 being prefixed to every symbol in my picture :(. And the document class still says 10pt. I tried some other syntax, but can't seem to get it to work :(. – Adriaan Jun 23 '13 at 16:03
  • @Adriaan try the updated answer, thanks for pointing that out. – giordano Jun 23 '13 at 16:11
  • 1
    @goirdano Works great! It does not change the parameter of the document class to 12pt, but it adds the line '\tikzset{every node/.append style={font={\fontsize{12pt}{14.4pt}\selectfont}}}' to the tex file, which seems to do the job nicely ;). Thanks again! – Adriaan Jun 23 '13 at 17:12

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.