gnuplotが画像の同じ高さにy1 = 0とy2 = 0を自動的に表示し、y1とy2軸のサイズが異なる簡単な方法はありますか?
私が知っている唯一の方法は、例えばy1とy2の上限と下限が0から等しい比例距離であることを確認することです。 -1は-10に行き、2は20に行くので動作しますset yrange [-1:2]
。set y2range [-10:20]
これは例です
#!/usr/bin/gnuplot -p
set term wxt #not important
unset key
set autoscale
set xrange [0:1]
set xzeroaxis #shows a dotted line where y=0 for y1.
set yrange[-1:2]
#set y2range[-10:20] #if you set an explicit range, it obviously won't work unless you plan it perfectly (like this)
#set y2range[-10:] #this does the minimum to get the plot in the frame (here -10 is the minimum, but the maximum seems to not really matter
#set y2range[:20]
#set y2range[:] #this is equivalent to just not having a set y2range line.
set xtics 0.2
set ytics 0.3
set y2tics 1
set mxtics 5
set mytics 5
set my2tics 5
set ytics nomirror #makes y1tics only show up on the left
f(x)=1
g(x)=10
plot f(x) axis x1y1 lc rgb 'blue', \
g(x) axis x1y2 lc rgb 'red';