Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to output a file in gnuplot multiplot mode?

Tags:

output

gnuplot

I am plotting graphs in gnuplot (version 4.6 patchlevel 5) multiplot mode, which are being updated using reread.

set multiplot layout 3, 3
do for [planeIter=4:10:3] for [ringIter=0:20:10] {
    plot for [quadIter=0:90:30] path/to/file \
    using 1:(column(1 + planeIter + ringIter + quadIter)) notitle
}
pause 10
reread

Previously, I have outputted png files using:

set terminal pngcairo dashed enhanced
plot path/to/file using 1:2
set output 'foo.png'

But I haven't been able to find how to output a file of the latest multiplot screen. Please would you tell me how I could do this? Thank you.

like image 524
Shenan Avatar asked Aug 19 '14 16:08

Shenan


1 Answers

As gnuplot will tell you:

you can't change the output in multiplot mode

So make sure you set it beforehand:

set terminal pngcairo dashed enhanced
set output 'foo.png'
set multiplot layout 3, 3
do for [planeIter=4:10:3] for [ringIter=0:20:10] {
    plot for [quadIter=0:90:30] path/to/file \
    using 1:(column(1 + planeIter + ringIter + quadIter)) notitle
}
unset multiplot
unset output
pause 10
reread

This is currently an infinite loop, so I assume that you are interrupting it manually. The unset lines will cause the output to be flushed, so your final image will be written.

like image 185
Tom Fenech Avatar answered Nov 02 '22 22:11

Tom Fenech