Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insertion of Greek letters in a graph legend using GNUplot

Tags:

gnuplot

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?

like image 215
mani Avatar asked Oct 19 '25 01:10

mani


2 Answers

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!

like image 76
sweber Avatar answered Oct 22 '25 04:10

sweber


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

like image 31
Christoph Avatar answered Oct 22 '25 05:10

Christoph



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!