Gnuplot 来自不同文件的两个 x 轴

Gnuplot two x-axis from different files

我想在具有两个不同 x 轴的图中绘制数据。一个应该是以年为单位的时间,另一个应该是 MJD 中的时间。 这是文件 1 中的示例(x 年):

    2011.27466   0.012
    2011.71704   0.019
    2011.71716   0.021
    2011.87012   0.045

这是文件 2 中的示例(MJD 中的 x):

   -654.25226   0.012
   -654.25177   0.019
   -492.64032   0.021
   -436.78577   0.045

Y 值(当然)相同。 我如何获得底部以年为单位的 x 和顶部以 MJD 为单位的 x 的图表?

使用axes x2y1使用第二个,顶轴:

set xlabel 'Time (in years)'
set x2label 'Time (in MJD)'
set xtics nomirror
set x2tics
plot 'file1.txt' using 1:2, 'file2.txt' using 1:2 axes x2y1