I tried to do set yabel={/*2.0 MyLabel}
based on the answer to this question, but that just printed the ylabel with those literals.
2 Answers
You can specify the font options simply by using the font
argument like so:
set xlabel "x-units" font "Times-Roman,12"
set ylabel "y-units" font "Times-Roman,12"
Or you can just leave out either parameter, say for example if you want to set the font size but not the font face:
set xlabel "x-units" font ",12"
set ylabel "y-units" font ",12"
The official gnuplot documentation can be found here, and I'd also recommend checking out http://www.gnuplotting.org/
-
1This looks much cleaner than the
"{/*2 Ylabel}"
stuff. Commented Jul 15, 2018 at 15:54
The terminal must have the enhanced
option enabled, and your syntax for setting labels is wrong (without =
). A working example:
set terminal pngcairo enhanced
set xlabel "Xlabel"
set ylabel "{/*2 Ylabel}"
set output 'fontsizetest.png'
plot x
Result:
-
This solution does not work in the context of www.burningcutlery.com/derek/bargraph/ when I am trying to output to pdf. I tried to add "enhanced" to the set terminal line in his script, but this resulted in syntax error for gnuplot. Commented Aug 12, 2013 at 6:42
-
@merlin2011 The
bargraph.pl
script uses thefig
terminal which does not support enhanced text (I don't know why). Commented Aug 12, 2013 at 7:54