GNUplot – polish letters in plots

I would like to share with method to put polish letters into plot using gnuplot.

You need to save somewhere sample.plt script which contains commands for gnuplot.
In my case it is: ‘sample.plt’

reset
set ylabel 'Procent ogólnej liczby osobników'
set xlabel 'Sezon'
set key top left
set title 'P_{recover} = 0.2'
set bars small
set key samplen 0
// below line is important! sample.plt should be also encoded in iso_8859_2
set encoding iso_8859_2
set terminal postscript eps color  enhanced
set output 'path/to/output/file/ai_32_2.eps'
set terminal png
set output 'path/to/output/file/ai_32_2.png'
plot 'path/to/source/files/ai_32_2.dat'  us 1:2:3 w e lc rgb '#54e812' title 'Susceptible',
     'path/to/source/file/ai_32_2.dat'  us 1:6:7 w e pt 7 lc rgb '#0086c4'   title 'Recovered'

Run in command line:

gnuplot path/to/sample.plt

Output – plots with polish letters:

  • path/to/output/ai_32_2.eps
  • path/to/output/ai_32_2.png

It should does job properly!
Anyway works for me :-)