【问题标题】:how to tell gnuplot not to add an offset to x values when doing a plot with two y axes?在使用两个 y 轴进行绘图时,如何告诉 gnuplot 不要向 x 值添加偏移量?
【发布时间】:2017-02-13 06:17:31
【问题描述】:

我的数据文件如下所示:

0 12.6 303.1 3.4577387486

120 10.5 278.9 2.8814489572

...

640 9.45 301.3 2.5933040615

我的代码如下:

set xlabel "Tiempo (min)"
set ylabel "Corriente en el anillo (mA)"
set y2label "Flujo (fotones/s)"
set ytics nomirror
set y2tics
set tics out
set autoscale  y
set autoscale y2
plot 'tan_time_curr_flux.dat' using 1:3 lc rgb 'black' pt 6 lw 2 w lp axes x1y1 title "Corriente", 'tan_time_curr_flux.dat' using 1:4 lc rgb 'blue' pt 5 lw 2 w lp axes x2y2 title "Flujo"

我的情节看起来像:

如您所见,在各个数据点之间存在一点偏移,以 x 为单位。随着 x 的增长,它变得更加清晰。例如,通量 (flujo) 的实际最后一点是 640,2.59。但该图显示该点为 700, 2.59。如何告诉 gnuplot 不要在第二行(蓝色)添加任何偏移量?

非常感谢! :)

Ps 如果我绘制时间(第 1 列)与通量(第 4 列)或电流(第 3 列)的关系图... x 的值保持正常。 (即没有偏移)

【问题讨论】:

    标签: plot gnuplot


    【解决方案1】:

    我猜这是一个错误。

    但是,只需将axes x1y2 用于您的第二个绘图,因为您只有一个 x 值。

    【讨论】:

    • 我认为是 ..axes x1y2 使情节按原样进行。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多