gnuplot - 如何用 Gnuplot 演示 LaTeX 公式?

标签 gnuplot

我试图用 Gnuplot 5.0 演示 LaTeX 公式。 但是我发现有些 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

最佳答案

   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

关于gnuplot - 如何用 Gnuplot 演示 LaTeX 公式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56028362/

相关文章:

c++ - gnuplot-cpp 无法将命令提供给管道

3d - 使用 gnuplot 绘制三角形网格

dataset - Gnuplot:仅绘制最终数据集

gnuplot - 自定义可变大小点的不同颜色

plot - 使用 Octave 绘图的问题

ubuntu - 在 Ubuntu 环境中开始使用 gnuplot

gnuplot - 在 Gnuplot 中绘制 COVID-19 数据

gnuplot - 使用 GNU plot 在同一图表上绘制来自 .dat 文件和 .csv 文件的数据

statistics - 带有时间数据的 gnuplot 统计信息(从字符串转换为 float )作为单个参数失败

c++ - 来自 Qt C++ 应用程序的 Octave 图