绘制与 gnuplot 对齐的多轴
Plot multiple axis aligned with gnuplot
我正在尝试在左侧绘制时间序列,在右侧绘制直方图。我有 10000 个样本。文件 ts.dat 和 hist.dat 包含以正确形式绘制的点。如何绘制对齐的两个轴?使用下面的代码,gnuplot 对齐 canvas,并且由于 x 标签的长度不同,y 轴长度也不同。
set term pngcairo font "Times New Roman, 8" size 640, 240
set out 'mp.png'
set multiplot
set tics out
set tics scale 0.5
unset key
set size .66, 1
set yrange[-6:6]
set xtics rotate by 45 right
set xlabel "Iteration no."
set ylabel "USD"
plot 'ts.dat' with lines
set origin .66, 0
set size .33, 1
set yrange [-6:6]
set format y ""
set style fill transparent solid 0.3
set xlabel "No. of occurences"
unset ylabel
plot 'hist.dat' using 2:1 with filledcurves
unset multiplot
检查help margins
。
如果您手动设置固定的下边距,例如set bmargin 3
或 set bmargin at screen 0.1
,两个图中底部的 x 轴应对齐。
我正在尝试在左侧绘制时间序列,在右侧绘制直方图。我有 10000 个样本。文件 ts.dat 和 hist.dat 包含以正确形式绘制的点。如何绘制对齐的两个轴?使用下面的代码,gnuplot 对齐 canvas,并且由于 x 标签的长度不同,y 轴长度也不同。
set term pngcairo font "Times New Roman, 8" size 640, 240
set out 'mp.png'
set multiplot
set tics out
set tics scale 0.5
unset key
set size .66, 1
set yrange[-6:6]
set xtics rotate by 45 right
set xlabel "Iteration no."
set ylabel "USD"
plot 'ts.dat' with lines
set origin .66, 0
set size .33, 1
set yrange [-6:6]
set format y ""
set style fill transparent solid 0.3
set xlabel "No. of occurences"
unset ylabel
plot 'hist.dat' using 2:1 with filledcurves
unset multiplot
检查help margins
。
如果您手动设置固定的下边距,例如set bmargin 3
或 set bmargin at screen 0.1
,两个图中底部的 x 轴应对齐。