2
votes

I want to plot a multiplot in gnuplot with two plots. One plot on top of another. The underlying data files for both plots will be constantly changing and every 5 seconds, both plots will be refreshed.

Is there a way to ensure that the xrange of the bottom plot always stays the same as the xrange of the top plot? The top plot will be auto scaled.

1

1 Answers

2
votes

Gnuplot has set xrange writeback | restore for this. As example consider

set xrange [-10:10]

set multiplot layout 1,2

set yrange [] writeback
plot sin(x)

set yrange restore
replot x/2
unset multiplot

That uses the autoscale limits of the first plot for the second plot. In your case use of course set xrange [] writeback ... set xrange [] restore.