# Use unicode font for cyrillic in gnuplot

Why I need to do this? I'n writting my diploma in laTeX and almost finish them, but I want to use in graph labels and legend the same font that LateX uses.

As I know, the default LaTeX font in CM, so I opened example font from /usr/share/texmf/fonts/type1/public/cm-super and /usr/share/texmf/fonts/type1/public/cm-unicode in font viewer and expect that they support cyrillic.

Next, according to http://gnuplot.sourceforge.net/demo_4.0/fontfile.html, I changed my gnuplot script:

``````set encoding utf8
set terminal postscript eps enhanced size 8in,5.4in fontfile "./sfci0900.pfb" "SFCI0900" 30

set output "./graph_new_font.eps"

set xlabel "{/SFCI0900 z/L_d}"
set xrange [0:0.1]
set ylabel "{/SFCI0900 Пиковая интенсивность}"
set yrange [0:10]
``````

I view the produced EPS with Evince, but only "z/L_d" font have changed, but ylabel is empty. :( IDIW?

-

This may be a bit of overkill, but it is the only way I can think of that might be able to accomplish what you want:

``````set terminal fig metric textspecial color;
set output "./graph_new_font.fig"
``````

That will output the `gnuplot` image to an `xfig` image. Next, you can use the `fig2tikz` script to conver the `.fig` file into a TikZ image:

``````fig2tikz ./graph_new_font.fig > ./graph_new_font.tikz
``````

Finally, you can then insert that image into your LaTeX document:

``````\input{graph_new_font.tikz}
``````

(make sure to `\usepackage{tikz}` in your preamble, of course).

Using this method, all of the text in your `gnuplot` image will be rendered by LaTeX itself; no need to mess with fonts. In the `gnuplot` file, just type the labels and legends as if you were writing them in LaTeX.

-
Thanks. As I understand, this also applies to epslatex or pdf terminal. – Sannis Dec 15 '10 at 21:34
Correct. Using the `fig` terminal was ultimately to get the graph into TikZ format, the benefit of which is that it would all be rendered in LaTeX (including the text). Удачи! – ESultanik Dec 15 '10 at 23:38