Define font style as a variable

試著忘記壹切 提交于 2019-12-20 02:52:13

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!