Insertion of Greek letters in a graph legend using GNUplot

17,682

Solution 1

I have found the way to solve this problem. The Greek letters can be inserted in SVG file using following path in the Inkscape:

Go to Text drop down menu and then click on Glyphs. Next, select font family such as Times New Roman. After that select Greek from script and all from Range options, respectively. Then Greek letters could easily be inserted in the Graph.

Solution 2

The correct way is to

  1. use enhanced option of the terminal (you did)
  2. wite {/Symbol a} for an alpha.

Search for symbols + gnuplot on the web, you'll find lists like http://mathewpeet.org/lists/symbols/ with codes understood by gnuplot!

Solution 3

Use a proper encoding (UTF-8) and insert the characters directly:

reset
set encoding utf8
set terminal svg size 410,250 enhanced fname 'Times New Roman' fsize "12" rounded dashed standalone
set output "data1.svg"

set linetype 1 lc rgb "#8b1a0e" lw 2
set linetype 2 lc rgb "#5e9c36" lw 2

set key bottom right
set style function linespoints
set samples 11
plot x title "N(α, T)", 2*x title "N(β, T)"

enter image description here

Share:
17,682
mani
Author by

mani

Updated on June 04, 2022

Comments

  • mani
    mani almost 2 years

    I am trying to incorporate greek symbols into my graph using following code, but keep getting similar error twice.

    warning: enhanced text mode parser - ignoring spurious }

    warning: enhanced text mode parser - ignoring spurious }

    reset
    
    # svg
    #set terminal svg size 410,250 fname "Times New Roman" \
    
    set terminal svg size 410,250, enhanced fname 'Times New Roman' \
    
    fsize "12" rounded dashed
    set output "data1.svg"
    
    set tics nomirror
    
    # color definitions
    set style line 1 lc rgb "#8b1a0e" pt 1 ps 1 lt 1 lw 2 # --- red
    set style line 2 lc rgb "#5e9c36" pt 2 ps 1 lt 2 lw 2 # --- green
    
    set key bottom right
    
    plot "abc.htm" using 1:2 title "N('\alpha', T)" w lp ls 1, \
     "abc.htm" using 1:3 title "N(\beta, T)" w lp ls 5
    

    PS: The code was running fine until I enabled enhanced mode of svg terminal, as I needed it for inserting greek letters in my graph legends. I am using version 4.6, patch level 5. Can any one help me out?