I typically set the output (and terminal) before going in multiplot mode. One thing you may be noticing is that some terminals don't draw the plots in a multiplot until you unset multiplot
(see help multiplot
).
The following works.
set term post enh color
set output "foo.ps"
set multiplot layout 2,1
plot sin(x)
plot cos(x)
unset multiplot
One issue with multiplot is that often you want to see the plot (e.g. using x11) and also put it in a file (e.g. postscript). The cleanest way to do this is using the load
command:
#foo.gp
set multiplot layout 2,1
plot sin(x)
plot cos(x)
unset multiplot
Now you can call this:
set term x11 persist
load "foo.gp"
set term post enh color
set output 'foo.ps'
load 'foo.gp'