gnuplot 如何将导数值打印到txt 文件?

gnuplot how to print out derivative value to txt file?

我正在绘制来自多个 txt 文件及其派生文件的数据。

data1 = "AAA.txt"
data2 = "BBB.txt"
data3 = "CCC.txt"
data4 = "DDD.txt"

plot data2 u 2:4 w l lt 1 lw 3.5 lc rgb "red" title "b-O", \
     data3 u 2:4 w l lt 1 lw 3.5 lc rgb "blue" title "c-O", \
     data1 u 2:4 w l lt 1 lw 3.5 lc rgb "web-green" title "a-O", \
     data4 u 2:4 w l lt 1 lw 3.5 lc rgb "forest-green" title "d-O", \
     data2 u (dx=-x0,x0=,-dx/2):(dy=-y0,y0=,dy/dx) smooth sbezier w l lt 1 lw 3.5 lc rgb "orange" title "b-O deri" axes x1y2, \
     data3 u (dx=-x0,x0=,-dx/2):(dy=-y0,y0=,dy/dx) smooth sbezier w l lt 1 lw 3.5 lc rgb "skyblue" title "c-O deri" axes x1y2, \
     data1 u (dx=-x0,x0=,-dx/2):(dy=-y0,y0=,dy/dx) smooth sbezier w l lt 1 lw 3.5 lc rgb "light-green" title "a-O deri" axes x1y2, \

我希望得到特定 x 范围内的导数斜率。为此,我需要对导数应用线性拟合,或者我需要将导数数据打印到txt文件并应用线性拟合。

我真的不知道如何将拟合应用于 Gnuplot 中的导数。所以我希望将衍生数据打印成txt文件,然后对衍生数据进行拟合。

我搜索了一些参考资料,但找不到在 Gnuplot 中将导数数据打印到 txt 文件的方法...是否可以应用“set print”命令打印出导数数据到 Gnuplot 中的 txt 文件?

我无法重现你的问题,因为你没有定义导数,但是:

您可以通过 table 将任何绘图导出到数据文件。例如:

set table 'valami.dat'
plot norm(x)
unset table