gnuplot: Hypertext with monospace?

白昼怎懂夜的黑 提交于 2021-01-28 14:16:25

问题


Is there a way to show the hypertext label with monospace? I would like to align some text and numbers in a hypertext label in a table like manner. But I couldn't get a monospace font as the hypertext labels. If I add font "Monospace,10" I'll get an error message ... unexpected or unrecognized token. Trying to use "\t" in the label was also not successful. I am using Win7/64, wxt-terminal, gnuplot 5.2.6. Any ideas?

My code:

### hypertext with monospace?
reset session

set title "Hypertext with monospace?" font "Monospace,20"

set samples 10
plot '+' u 1:($1**2):(sprintf("%10s% 10g\n%10s% 10g","SomeValue",$1,"Square",$1**2)) \
    w labels hypertext point pt 7 ps 3 lc rgb "red" notitle 
### end of code

The result:


回答1:


Apparently, the fonts need to be set with the terminal and cannot be set independently just for the hypertext labels. So, if you set

set term wxt font "Monospace,12"

You'll get:

However,

set term qt font "Monospace,12"

doesn't give monospace hypertext labels in a qt terminal. I don't know why.



来源:https://stackoverflow.com/questions/55482054/gnuplot-hypertext-with-monospace

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