我有以下脚本:
set xlabel "y"
set ylabel "rw[j]"
set title "P-D diagram"
set xzeroaxis
unset key
plot [0.5:1] \
-5.71429*x title "L[-5]" linetype 1, \
-4.28571*x title "U[-5]" linetype 3, \
-4.71429*x title "L[-4]" linetype 1, \
-3.28571*x title "U[-4]" linetype 3, \
-3.71429*x title "L[-3]" linetype 1, \
-2.28571*x title "U[-3]" linetype 3, \
-2.71429*x title "L[-2]" linetype 1, \
-1.28571*x title "U[-2]" linetype 3, \
-1.71429*x title "L[-1]" linetype 1, \
-0.285714*x title "U[-1]" linetype 3, \
-0.714286*x title "L[0]" linetype 1, \
0.714286*x title "U[0]" linetype 3, \
0.285714*x title "L[1]" linetype 1, \
1.71429*x title "U[1]" linetype 3, \
1.28571*x title "L[2]" linetype 1, \
2.71429*x title "U[2]" linetype 3, \
2.28571*x title "L[3]" linetype 1, \
3.71429*x title "U[3]" linetype 3, \
3.28571*x title "L[4]" linetype 1, \
4.71429*x title "U[4]" linetype 3, \
4.28571*x title "L[5]" linetype 1, \
5.71429*x title "U[5]" linetype 3, \
(0.500000<= x && x <= 0.531250) ? 0.000000:1.0/0.0 linetype 4,\
(0.531250<= x && x <= 0.562500) ? 0.000000:1.0/0.0 linetype 4,\
(0.562500<= x && x <= 0.593750) ? 0.000000:1.0/0.0 linetype 4,\
(0.593750<= x && x <= 0.625000) ? 0.000000:1.0/0.0 linetype 4,\
(0.625000<= x && x <= 0.656250) ? 0.000000:1.0/0.0 linetype 4,\
(0.656250<= x && x <= 0.687500) ? 0.000000:1.0/0.0 linetype 4,\
(0.687500<= x && x <= 0.718750) ? 0.000000:1.0/0.0 linetype 4,\
(0.718750<= x && x <= 0.750000) ? 0.000000:1.0/0.0 linetype 4,\
(0.750000<= x && x <= 0.781250) ? 0.000000:1.0/0.0 linetype 4,\
(0.781250<= x && x <= 0.812500) ? 0.000000:1.0/0.0 linetype 4,\
(0.812500<= x && x <= 0.843750) ? 0.000000:1.0/0.0 linetype 4,\
(0.843750<= x && x <= 0.875000) ? 0.000000:1.0/0.0 linetype 4,\
(0.875000<= x && x <= 0.906250) ? 0.000000:1.0/0.0 linetype 4,\
(0.906250<= x && x <= 0.937500) ? 0.000000:1.0/0.0 linetype 4,\
(0.937500<= x && x <= 0.968750) ? 0.000000:1.0/0.0 linetype 4,\
(0.968750<= x && x <= 1.000000) ? 0.000000:1.0/0.0 linetype 4,\
(0.500000<= x && x <= 0.531250) ? -2.312500:1.0/0.0 linetype 4,\
(0.531250<= x && x <= 0.562500) ? -2.500000:1.0/0.0 linetype 4,\
(0.562500<= x && x <= 0.593750) ? -2.625000:1.0/0.0 linetype 4,\
(0.593750<= x && x <= 0.625000) ? -2.750000:1.0/0.0 linetype 4,\
(0.625000<= x && x <= 0.656250) ? -2.937500:1.0/0.0 linetype 4,\
(0.656250<= x && x <= 0.687500) ? -3.062500:1.0/0.0 linetype 4,\
(0.687500<= x && x <= 0.718750) ? -3.187500:1.0/0.0 linetype 4,\
(0.718750<= x && x <= 0.750000) ? -3.375000:1.0/0.0 linetype 4,\
(0.750000<= x && x <= 0.781250) ? -3.500000:1.0/0.0 linetype 4,\
(0.781250<= x && x <= 0.812500) ? -3.625000:1.0/0.0 linetype 4,\
(0.812500<= x && x <= 0.843750) ? -3.812500:1.0/0.0 linetype 4,\
(0.843750<= x && x <= 0.875000) ? -3.937500:1.0/0.0 linetype 4,\
(0.875000<= x && x <= 0.906250) ? -4.125000:1.0/0.0 linetype 4,\
(0.906250<= x && x <= 0.937500) ? -4.250000:1.0/0.0 linetype 4,\
(0.937500<= x && x <= 0.968750) ? -4.375000:1.0/0.0 linetype 4,\
(0.968750<= x && x <= 1.000000) ? -4.562500:1.0/0.0 linetype 4,\
(0.500000<= x && x <= 0.531250) ? -1.812500:1.0/0.0 linetype 4,\
(0.531250<= x && x <= 0.562500) ? -1.937500:1.0/0.0 linetype 4,\
(0.562500<= x && x <= 0.593750) ? -2.062500:1.0/0.0 linetype 4,\
(0.593750<= x && x <= 0.625000) ? -2.187500:1.0/0.0 linetype 4,\
(0.625000<= x && x <= 0.656250) ? -2.312500:1.0/0.0 linetype 4,\
(0.656250<= x && x <= 0.687500) ? -2.437500:1.0/0.0 linetype 4,\
(0.687500<= x && x <= 0.718750) ? -2.500000:1.0/0.0 linetype 4,\
(0.718750<= x && x <= 0.750000) ? -2.625000:1.0/0.0 linetype 4,\
(0.750000<= x && x <= 0.781250) ? -2.750000:1.0/0.0 linetype 4,\
(0.781250<= x && x <= 0.812500) ? -2.875000:1.0/0.0 linetype 4,\
(0.812500<= x && x <= 0.843750) ? -3.000000:1.0/0.0 linetype 4,\
(0.843750<= x && x <= 0.875000) ? -3.125000:1.0/0.0 linetype 4,\
(0.875000<= x && x <= 0.906250) ? -3.250000:1.0/0.0 linetype 4,\
(0.906250<= x && x <= 0.937500) ? -3.312500:1.0/0.0 linetype 4,\
(0.937500<= x && x <= 0.968750) ? -3.437500:1.0/0.0 linetype 4,\
(0.968750<= x && x <= 1.000000) ? -3.562500:1.0/0.0 linetype 4,\
(0.500000<= x && x <= 0.531250) ? -1.312500:1.0/0.0 linetype 4,\
(0.531250<= x && x <= 0.562500) ? -1.437500:1.0/0.0 linetype 4,\
(0.562500<= x && x <= 0.593750) ? -1.500000:1.0/0.0 linetype 4,\
(0.593750<= x && x <= 0.625000) ? -1.562500:1.0/0.0 linetype 4,\
(0.625000<= x && x <= 0.656250) ? -1.687500:1.0/0.0 linetype 4,\
(0.656250<= x && x <= 0.687500) ? -1.750000:1.0/0.0 linetype 4,\
(0.687500<= x && x <= 0.718750) ? -1.812500:1.0/0.0 linetype 4,\
(0.718750<= x && x <= 0.750000) ? -1.937500:1.0/0.0 linetype 4,\
(0.750000<= x && x <= 0.781250) ? -2.000000:1.0/0.0 linetype 4,\
(0.781250<= x && x <= 0.812500) ? -2.062500:1.0/0.0 linetype 4,\
(0.812500<= x && x <= 0.843750) ? -2.187500:1.0/0.0 linetype 4,\
(0.843750<= x && x <= 0.875000) ? -2.250000:1.0/0.0 linetype 4,\
(0.875000<= x && x <= 0.906250) ? -2.375000:1.0/0.0 linetype 4,\
(0.906250<= x && x <= 0.937500) ? -2.437500:1.0/0.0 linetype 4,\
(0.937500<= x && x <= 0.968750) ? -2.500000:1.0/0.0 linetype 4,\
(0.968750<= x && x <= 1.000000) ? -2.625000:1.0/0.0 linetype 4,\
(0.500000<= x && x <= 0.531250) ? -0.812500:1.0/0.0 linetype 4,\
(0.531250<= x && x <= 0.562500) ? -0.875000:1.0/0.0 linetype 4,\
(0.562500<= x && x <= 0.593750) ? -0.937500:1.0/0.0 linetype 4,\
(0.593750<= x && x <= 0.625000) ? -1.000000:1.0/0.0 linetype 4,\
(0.625000<= x && x <= 0.656250) ? -1.062500:1.0/0.0 linetype 4,\
(0.656250<= x && x <= 0.687500) ? -1.125000:1.0/0.0 linetype 4,\
(0.687500<= x && x <= 0.718750) ? -1.125000:1.0/0.0 linetype 4,\
(0.718750<= x && x <= 0.750000) ? -1.187500:1.0/0.0 linetype 4,\
(0.750000<= x && x <= 0.781250) ? -1.250000:1.0/0.0 linetype 4,\
(0.781250<= x && x <= 0.812500) ? -1.312500:1.0/0.0 linetype 4,\
(0.812500<= x && x <= 0.843750) ? -1.375000:1.0/0.0 linetype 4,\
(0.843750<= x && x <= 0.875000) ? -1.437500:1.0/0.0 linetype 4,\
(0.875000<= x && x <= 0.906250) ? -1.500000:1.0/0.0 linetype 4,\
(0.906250<= x && x <= 0.937500) ? -1.500000:1.0/0.0 linetype 4,\
(0.937500<= x && x <= 0.968750) ? -1.562500:1.0/0.0 linetype 4,\
(0.968750<= x && x <= 1.000000) ? -1.625000:1.0/0.0 linetype 4,\
(0.500000<= x && x <= 0.531250) ? -0.312500:1.0/0.0 linetype 4,\
(0.531250<= x && x <= 0.562500) ? -0.375000:1.0/0.0 linetype 4,\
(0.562500<= x && x <= 0.593750) ? -0.375000:1.0/0.0 linetype 4,\
(0.593750<= x && x <= 0.625000) ? -0.375000:1.0/0.0 linetype 4,\
(0.625000<= x && x <= 0.656250) ? -0.437500:1.0/0.0 linetype 4,\
(0.656250<= x && x <= 0.687500) ? -0.437500:1.0/0.0 linetype 4,\
(0.687500<= x && x <= 0.718750) ? -0.437500:1.0/0.0 linetype 4,\
(0.718750<= x && x <= 0.750000) ? -0.500000:1.0/0.0 linetype 4,\
(0.750000<= x && x <= 0.781250) ? -0.500000:1.0/0.0 linetype 4,\
(0.781250<= x && x <= 0.812500) ? -0.500000:1.0/0.0 linetype 4,\
(0.812500<= x && x <= 0.843750) ? -0.562500:1.0/0.0 linetype 4,\
(0.843750<= x && x <= 0.875000) ? -0.562500:1.0/0.0 linetype 4,\
(0.875000<= x && x <= 0.906250) ? -0.625000:1.0/0.0 linetype 4,\
(0.906250<= x && x <= 0.937500) ? -0.625000:1.0/0.0 linetype 4,\
(0.937500<= x && x <= 0.968750) ? -0.625000:1.0/0.0 linetype 4,\
(0.968750<= x && x <= 1.000000) ? -0.687500:1.0/0.0 linetype 4,\
(0.500000<= x && x <= 0.531250) ? 0.312500:1.0/0.0 linetype 4,\
(0.531250<= x && x <= 0.562500) ? 0.375000:1.0/0.0 linetype 4,\
(0.562500<= x && x <= 0.593750) ? 0.375000:1.0/0.0 linetype 4,\
(0.593750<= x && x <= 0.625000) ? 0.375000:1.0/0.0 linetype 4,\
(0.625000<= x && x <= 0.656250) ? 0.437500:1.0/0.0 linetype 4,\
(0.656250<= x && x <= 0.687500) ? 0.437500:1.0/0.0 linetype 4,\
(0.687500<= x && x <= 0.718750) ? 0.437500:1.0/0.0 linetype 4,\
(0.718750<= x && x <= 0.750000) ? 0.500000:1.0/0.0 linetype 4,\
(0.750000<= x && x <= 0.781250) ? 0.500000:1.0/0.0 linetype 4,\
(0.781250<= x && x <= 0.812500) ? 0.500000:1.0/0.0 linetype 4,\
(0.812500<= x && x <= 0.843750) ? 0.562500:1.0/0.0 linetype 4,\
(0.843750<= x && x <= 0.875000) ? 0.562500:1.0/0.0 linetype 4,\
(0.875000<= x && x <= 0.906250) ? 0.625000:1.0/0.0 linetype 4,\
(0.906250<= x && x <= 0.937500) ? 0.625000:1.0/0.0 linetype 4,\
(0.937500<= x && x <= 0.968750) ? 0.625000:1.0/0.0 linetype 4,\
(0.968750<= x && x <= 1.000000) ? 0.687500:1.0/0.0 linetype 4,\
(0.500000<= x && x <= 0.531250) ? 0.812500:1.0/0.0 linetype 4,\
(0.531250<= x && x <= 0.562500) ? 0.875000:1.0/0.0 linetype 4,\
(0.562500<= x && x <= 0.593750) ? 0.937500:1.0/0.0 linetype 4,\
(0.593750<= x && x <= 0.625000) ? 1.000000:1.0/0.0 linetype 4,\
(0.625000<= x && x <= 0.656250) ? 1.062500:1.0/0.0 linetype 4,\
(0.656250<= x && x <= 0.687500) ? 1.125000:1.0/0.0 linetype 4,\
(0.687500<= x && x <= 0.718750) ? 1.125000:1.0/0.0 linetype 4,\
(0.718750<= x && x <= 0.750000) ? 1.187500:1.0/0.0 linetype 4,\
(0.750000<= x && x <= 0.781250) ? 1.250000:1.0/0.0 linetype 4,\
(0.781250<= x && x <= 0.812500) ? 1.312500:1.0/0.0 linetype 4,\
(0.812500<= x && x <= 0.843750) ? 1.375000:1.0/0.0 linetype 4,\
(0.843750<= x && x <= 0.875000) ? 1.437500:1.0/0.0 linetype 4,\
(0.875000<= x && x <= 0.906250) ? 1.500000:1.0/0.0 linetype 4,\
(0.906250<= x && x <= 0.937500) ? 1.500000:1.0/0.0 linetype 4,\
(0.937500<= x && x <= 0.968750) ? 1.562500:1.0/0.0 linetype 4,\
(0.968750<= x && x <= 1.000000) ? 1.625000:1.0/0.0 linetype 4,\
(0.500000<= x && x <= 0.531250) ? 1.312500:1.0/0.0 linetype 4,\
(0.531250<= x && x <= 0.562500) ? 1.437500:1.0/0.0 linetype 4,\
(0.562500<= x && x <= 0.593750) ? 1.500000:1.0/0.0 linetype 4,\
(0.593750<= x && x <= 0.625000) ? 1.562500:1.0/0.0 linetype 4,\
(0.625000<= x && x <= 0.656250) ? 1.687500:1.0/0.0 linetype 4,\
(0.656250<= x && x <= 0.687500) ? 1.750000:1.0/0.0 linetype 4,\
(0.687500<= x && x <= 0.718750) ? 1.812500:1.0/0.0 linetype 4,\
(0.718750<= x && x <= 0.750000) ? 1.937500:1.0/0.0 linetype 4,\
(0.750000<= x && x <= 0.781250) ? 2.000000:1.0/0.0 linetype 4,\
(0.781250<= x && x <= 0.812500) ? 2.062500:1.0/0.0 linetype 4,\
(0.812500<= x && x <= 0.843750) ? 2.187500:1.0/0.0 linetype 4,\
(0.843750<= x && x <= 0.875000) ? 2.250000:1.0/0.0 linetype 4,\
(0.875000<= x && x <= 0.906250) ? 2.375000:1.0/0.0 linetype 4,\
(0.906250<= x && x <= 0.937500) ? 2.437500:1.0/0.0 linetype 4,\
(0.937500<= x && x <= 0.968750) ? 2.500000:1.0/0.0 linetype 4,\
(0.968750<= x && x <= 1.000000) ? 2.625000:1.0/0.0 linetype 4,\
(0.500000<= x && x <= 0.531250) ? 1.812500:1.0/0.0 linetype 4,\
(0.531250<= x && x <= 0.562500) ? 1.937500:1.0/0.0 linetype 4,\
(0.562500<= x && x <= 0.593750) ? 2.062500:1.0/0.0 linetype 4,\
(0.593750<= x && x <= 0.625000) ? 2.187500:1.0/0.0 linetype 4,\
(0.625000<= x && x <= 0.656250) ? 2.312500:1.0/0.0 linetype 4,\
(0.656250<= x && x <= 0.687500) ? 2.437500:1.0/0.0 linetype 4,\
(0.687500<= x && x <= 0.718750) ? 2.500000:1.0/0.0 linetype 4,\
(0.718750<= x && x <= 0.750000) ? 2.625000:1.0/0.0 linetype 4,\
(0.750000<= x && x <= 0.781250) ? 2.750000:1.0/0.0 linetype 4,\
(0.781250<= x && x <= 0.812500) ? 2.875000:1.0/0.0 linetype 4,\
(0.812500<= x && x <= 0.843750) ? 3.000000:1.0/0.0 linetype 4,\
(0.843750<= x && x <= 0.875000) ? 3.125000:1.0/0.0 linetype 4,\
(0.875000<= x && x <= 0.906250) ? 3.250000:1.0/0.0 linetype 4,\
(0.906250<= x && x <= 0.937500) ? 3.312500:1.0/0.0 linetype 4,\
(0.937500<= x && x <= 0.968750) ? 3.437500:1.0/0.0 linetype 4,\
(0.968750<= x && x <= 1.000000) ? 3.562500:1.0/0.0 linetype 4,\
(0.500000<= x && x <= 0.531250) ? 2.312500:1.0/0.0 linetype 4,\
(0.531250<= x && x <= 0.562500) ? 2.500000:1.0/0.0 linetype 4,\
(0.562500<= x && x <= 0.593750) ? 2.625000:1.0/0.0 linetype 4,\
(0.593750<= x && x <= 0.625000) ? 2.750000:1.0/0.0 linetype 4,\
(0.625000<= x && x <= 0.656250) ? 2.937500:1.0/0.0 linetype 4,\
(0.656250<= x && x <= 0.687500) ? 3.062500:1.0/0.0 linetype 4,\
(0.687500<= x && x <= 0.718750) ? 3.187500:1.0/0.0 linetype 4,\
(0.718750<= x && x <= 0.750000) ? 3.375000:1.0/0.0 linetype 4,\
(0.750000<= x && x <= 0.781250) ? 3.500000:1.0/0.0 linetype 4,\
(0.781250<= x && x <= 0.812500) ? 3.625000:1.0/0.0 linetype 4,\
(0.812500<= x && x <= 0.843750) ? 3.812500:1.0/0.0 linetype 4,\
(0.843750<= x && x <= 0.875000) ? 3.937500:1.0/0.0 linetype 4,\
(0.875000<= x && x <= 0.906250) ? 4.125000:1.0/0.0 linetype 4,\
(0.906250<= x && x <= 0.937500) ? 4.250000:1.0/0.0 linetype 4,\
(0.937500<= x && x <= 0.968750) ? 4.375000:1.0/0.0 linetype 4,\
(0.968750<= x && x <= 1.000000) ? 4.562500:1.0/0.0 linetype 4
pause - 1
我希望我能够绘制一个实际的楼梯而不是那些跳跃,而且我确实认为在y轴上给出两条连续的橙色线条,有一个间隙delta_y
,但它不应该是因为y
轴被划分为连续的间隔。
任何提示? (PS。脚本是由程序生成的,我的gnuplot版本是5.2)
答案 0 :(得分:1)
您可以使用int
功能将(正)数字向下舍入到下一个整数。使用正确的因素,这会产生适当的步骤。例如,您可以执行以下操作,以大小为5*x
的步骤绘制0.31250
:
rounddown(x,p) = int(x/p)*p
plot rounddown(5*x,0.31250)
请注意,对于低分辨率,可能需要增加样本数量,例如如下:
set samples 10000