How to add a greek character in png file created by gnuplot

15,334

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.

Share:
15,334
HXGuo
Author by

HXGuo

I am using debian, I like it.

Updated on June 05, 2022

Comments

  • HXGuo
    HXGuo about 2 years

    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.