问题
Is it possible to define different font styles (in gnuplot), so that I can refer to them later by an index instead of repeating them all every time, for example: font1 = font "Helvetica,12" ; font2 = font "Verdana, 12" and so on
回答1:
You can use macros for this.
set macros
With this enabled (in version 5 by default), you can define string variables which are replaced in a command with their content before the command is executed, like
set macros
Helvetica = 'font "Helvetica, 12"'
Verdana = 'font " Verdana, 12"'
set title "My title" @Verdana
set xlabel "My x-label" @Helvetica
plot x
来源:https://stackoverflow.com/questions/30427738/define-font-style-as-a-variable