如何解决gnuplot:如何更改超文本的字体大小?
到目前为止,我找不到任何有关如何更改超文本字体大小的文档。
来自help hypertext
,但没有提到字体大小。
plot 'data' using 1:2:0 with labels hypertext point pt 7 \ title 'mouse over point to see its order in data set'
并且font ",30"
的以下使用没有任何作用:
plot 'data' using 1:2:0 with labels font ",30" hypertext point pt 7
除此之外,help labels
列出了以下语法的可能性
sprintf("{/=30 %d}",$1**2)
但是,此测试和以下所有测试均未获得预期的结果:标准尺寸的标签和标记,但只有较大尺寸的超文本。
最后一次测试会导致超文本较大,标签/抽号很小,但是图形的比例却很丑。有什么解决办法吗?
代码:
### hypertext font size
# Test1:
reset session
set title "default terminal " # in my case wxt
plot '+' u 1:($1**2):($1**2) w labels font ",30" hypertext point pt 7 ps 3 lc rgb "red" notitle
pause -1
# Test2:
reset session
set term wxt font ",10"
set title "explicitely set wxt terminal" font ",10"
plot '+' u 1:($1**2):($1**2) w labels font ",30" hypertext point pt 7 ps 3 lc rgb "red" notitle
pause -1
# Test3:
reset session
set title "only labels without hypertext using {/=30 } syntax"
plot '+' u 1:($1**2):(sprintf("{/=30 %d}",$1**2)) w labels hypertext point pt 7 ps 3 lc rgb "red" notitle
pause -1
# Test4:
reset session
set term wxt font ",30"
set title "setting terminal font to 30"
plot '+' u 1:($1**2):($1**2) w labels hypertext point pt 7 ps 3 lc rgb "red" notitle
pause -1
# Test5:
reset session
set term wxt font ",30"
set title "setting terminal font to 30 and the labels to 10 again" font ",10"
set xlabel font ",10"
set ylabel font ",10"
set xtics font ",10"
set ytics font ",10"
plot '+' u 1:($1**2):($1**2) w labels hypertext point pt 7 ps 3 lc rgb "red" notitle
### end of code
解决方法
这是修改显示的图例命令以指定与默认字体分开的超文本字体后,在分布式演示程序“ hypertext.dem”中qt终端上显示的屏幕截图:
gnuplot> load 'hypertext.dem'
gnuplot> ^C
gnuplot> plot 'cities.dat' using 5:4:(City(1,3)):(Scale(3)) with labels hypertext \
point pt 7 ps var lc rgb "#ffee99" font "VladimirScript,20",\
'cities.dat' using 5:4:(strcol(1)) with labels font ",5"
相同的命令适用于wxt终端。
该命令或多或少也适用于svg终端,但我从未想过如何使svg超文本的边界框调整为适应更改后的字体大小。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。