GNUplot中文字体问题


gnuplot> set term png font '/usr/common/fonts/simsun.ttc,14'              #改变字体
gnuplot> set out 'cn.png'
gnuplot> rep
gnuplot> set term pop
gnuplot> rep
gnuplot> !gthumb cn.png

注意simsun.ttc是你在windows字体目录下copy过来的字体,放在'/usr/common/fonts/' 目录下。你直接在gnuplot中输入这些命令就可以得到支持中文的图像。为何这么简单,因为GNU/ubuntu默认内码是UTF-8,和文件编码一样。

在linux中,为避免在set term中的font中要加入长路径,在本人多次实验中也已解决。

打开/home/sxp/目录下.bashrc文件进行编辑,在最后添加                            #sxp是我的用户名

export GDFONTPATH="/usr/common/fonts/"

上面的路径中存放的是你的copy过来的中文字体。

posted on 2012-04-09 14:08  sprzhing  阅读(4474)  评论(0编辑  收藏  举报

导航