1

I have a script that closes immediately after opening. I've tried pause -1, but then I have an empty window. I've also tried set output but apparently I can't do that with multiplot

Is there a way to set output while using multiplot? I tried setting output before setting multiplot, but the ps file was blank

Edit: The solution I found most useful was "pause mouse". I was also told I could use set output and just do "plot file1, file2, file3", but I'm having some issues with the syntax for that.

1
  • Does using gnuplot -persist or set wxt persist help? Commented Jun 27, 2012 at 15:33

1 Answer 1

2

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'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.