Как продемонстрировать формулу LaTeX с Gnuplot? - PullRequest
1 голос
/ 07 мая 2019

Я попытался продемонстрировать формулу LaTeX с Gnuplot 5.0.Но я обнаружил, что некоторые команды LaTeX недоступны.

Это мой код Gnuplot:

set termoption enhanced

set title   "Title test^a \alpha $\alpha$" font "CMU-Serif, 18"
set xlabel  "Month"
set ylabel  "Precipitation (mm)"
set xrange  [0.5: 12.5]
set xtics   1,1,12
set key
set pointintervalbox 2

plot    "08_Data.dat"   using 1:2 with linespoints \
                        linecolor "#FF7800" linewidth 2 pointtype 7 pointsize 0.75 pointinterval -1 \
                        title "Beijing",\
        "08_Data.dat"   using 1:3 with linespoints \
                        linecolor "#00A0DC" linewidth 2 pointtype 7 pointsize 0.75 pointinterval -1 \
                        title "Shanghai",

set output
pause (-1)

В результате команда LaTeX test^a работает хорошо, но LaTeX \alpha и$\alpha$ не работает:

enter image description here

Это файл: 08_Data.dat:

1       2.5     38.1
2       5.1     58.4
3       10.2    81.3    
4       25.4    101.6
5       27.9    114.3
6       71.1    152.4
7       175.3   129.5
8       182.9   132.1
9       48.3    154.9
10      17.8    61.0
11      5.1     50.8
12      2.5     35.6

Ответы [ 2 ]

0 голосов
/ 01 июля 2019
   set term tikz standalone size 7cm, 3cm fontscale 0.6
   set ylabel '{\LaTeX\ -- $ \gamma $}'
   set xlabel '{\LaTeX\ -- $ x $}'
   set output 'example.tex'
   plot [0:1] gamma(x) title '$ \gamma(x) $'
   unset output
   !pdflatex example

screenshot of pdf output

0 голосов
/ 07 мая 2019

Вы пытались напрямую ввести буквенный символ в коде gnuplot?Я предполагаю, что gnuplot понимает UTF-8.

set title "test^a α α" font "CMU-Serif, 18"
plot x

Результат:

enter image description here

...