来自gnuplot代码的美元符号与epslatex产生冲突

时间:2015-11-20 01:22:47

标签: gnuplot dollar-sign

为了仅在函数参数(x轴)的选定区域中制作填充曲线,我发现在线程上使用过滤器是一个好主意"在Gnuplot&#34中填充数据曲线下面的几个部分;。

问题在于使用epslatex时,用于指向变量的$符号在尝试使用latex进行编译时会产生错误。

还有其他可能解决变量吗?

set samples 100
set xrange [-2:2]
f(x) = -x**2 + 4

set linetype 1 lc rgb '#A3001E'

set style fill transparent solid 0.35 noborder
filter(x,min,max) = (x > min && x < max) ? x : 1/0
plot '+' using (filter($1, -1, -0.5)):(f($1)) with filledcurves x1 lt 1 notitle,\
     ''  using (filter($1, 0.2, 0.8)):(f($1)) with filledcurves x1 lt 1 notitle,\
     ''  using 1:(f($1)) with lines lw 3 lt 1 title 'curve'

1 个答案:

答案 0 :(得分:1)

我猜这个问题来自自动标题中的p,它是由gnuplot创建的。使用$通过自定义覆盖:

title

或使用plot ... title 'my custom escaped title' 代替捷径column(1)