向 gnuplot 中的多列添加偏移量
add offset to multiple columns in gnuplot
我正在尝试从多列文件中绘制,其中第一列是 x,其余应该是 y 列,如下所示:
plot for[col=2:36:1] 'datafile' using 1:col with lines lc rgb 'black' notitle
这很好用,但我想做的是将所有 y 列偏移一个常数值。
我试过这样的事情:
plot for[col=2:36:1] 'datafile' using 1:(col-const) with lines lc rgb 'black' notitle
但它不起作用(它似乎绘制了变量 col 和常量值 const 之间的差异)。
有办法吗?我在这里找到了如何偏移 2 列文件(或文件中的特定列)的 y 列
plot 'otherdatafile' using 1:(-const) with lines
但这可以扩展到我的案例吗?
提前致谢,
卢锡安
使用 1:(column(col)-const) 应该有效
我正在尝试从多列文件中绘制,其中第一列是 x,其余应该是 y 列,如下所示:
plot for[col=2:36:1] 'datafile' using 1:col with lines lc rgb 'black' notitle
这很好用,但我想做的是将所有 y 列偏移一个常数值。
我试过这样的事情:
plot for[col=2:36:1] 'datafile' using 1:(col-const) with lines lc rgb 'black' notitle
但它不起作用(它似乎绘制了变量 col 和常量值 const 之间的差异)。
有办法吗?我在这里找到了如何偏移 2 列文件(或文件中的特定列)的 y 列
plot 'otherdatafile' using 1:(-const) with lines
但这可以扩展到我的案例吗?
提前致谢,
卢锡安
使用 1:(column(col)-const) 应该有效