如何在由gnuplot创建的png文件中添加一个希腊字符 [英] How to add a greek character in png file created by gnuplot
问题描述
$ b $ p然后,我在gnuplot文件中使用后面的脚本:
设置词语png增强字体'/home/Tom/usr/fonts/truetype/msttcorefonts/verdana.ttf'
设置'xrd。 png'
set xlabel'2 {/ Symbol q}';
set ylabel'Count';
set xrange [:];
set yrange [:];
unset key;
set border lw 1;
绘制'./data.txt'使用1:2与l线型1线宽1;
set term xterm;
出发;
但是,当我运行我的脚本时,出现以下错误:
gdImageStringFT:用字体打印字符串q时找不到/打开字体符号
gdImageStringFT:用字体打印字符串q时找不到/打开字体
这可能是因为我使用的字体verdana.ttf不正确。
但是,我可以在我自己的电脑上用Debian系统使用这种字体。
C $ C> /符号。那将不会使用Verdana字体。
根据这个页面,Verdana字体包含希腊字母。
使用UTF-8编码加入设置编码utf8
到你的gnuplot文件。然后插入unicode符号(根据本页:θ,希腊语小字母theta,U + 03B8)到标签字符串使用您最喜爱的文本编辑器。
I am using a commercial sever with FreeBSD system without root account. I install gnuplot with my account. But, I can not set up fonts. So, I copy the fonts files in my home directory such as ~/usr/fonts
Then, I use followed scripts in my gnuplot files:
set term png enhanced font '/home/Tom/usr/fonts/truetype/msttcorefonts/verdana.ttf'
set out 'xrd.png'
set xlabel '2 {/Symbol q}';
set ylabel 'Count';
set xrange [:];
set yrange [:];
unset key;
set border lw 1;
plot './data.txt' using 1:2 with l linetype 1 linewidth 1;
set term xterm;
set out ;
However, I get the following errors when I run my scripts:
gdImageStringFT: Could not find/open font while printing string q with font Symbol
gdImageStringFT: Could not find/open font while printing string q with font Symbol
This might be because the font 'verdana.ttf' that I am using is not correct. But, I can use this font on my own PC with a Debian system.
Do not use /Symbol
. That will not use the Verdana font.
According to this page, the Verdana font includes greek letters.
Use UTF-8 encoding by adding set encoding utf8
to your gnuplot file. Then insert the unicode symbol (according to this page: θ, greek small letter theta, U+03B8) into the label string using your favorite text editor.
这篇关于如何在由gnuplot创建的png文件中添加一个希腊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!