Version 6 saves the commands that create a multiplot in a datablock $GPVAL_LAST_MULTIPLOT. However if the commands are embedded in a bracketed clause then the entire bracketed clause is saved rather than just the multiplot commands. This may be harmless or it may cause a non-recoverable error depending on what other commands are in that clause.
Reproducer:
#
# problem with v6 multiplot save mechanism
# if the multiplot is inside a bracketed clause, the whole clause gets saved
#
if (0) {
print "this line never executed"
} else {
if (1) {
print "lines before the multiplot should not be saved"
set multiplot layout 2,1
plot sin(x) with lp lt 2
plot cos(x) with lp lt 4
unset multiplot
print "lines after the multiplot should not be saved"
}
}
print "======================================="
print "Commands saved in $GPVAL_LAST_MULTIPLOT"
print $GPVAL_LAST_MULTIPLOT
print "======================================="
replot