Reputation: 101
I have written a Gnuplot code that plots two figures on one window. I want a total of eight plot to appear in one window. Here a code for two plots in one window given:
#!/usr/bin/gnuplot
reset
set terminal pngcairo size 1000,1000
set output 'spectrogram.png'
set multiplot
unset key
set lmargin at screen 0.1
set rmargin at screen 0.9
set bmargin at screen 0.3
set tmargin at screen 0.9
set label 1 '(a)' font "Times, 15" at 0.8,15 right
set label 2 '(b)' font "Times, 15" at 7.5,90 right
set size ratio 2.5
set style data lines
set xtics format ""
set x2tics nomirror
set ytics out nomirror
set ytics 0,15
set x2label "Vs (km/s)" offset 1
set ylabel 'Depth (km)' offset 1
set xrange [0:5]
set yrange [200:0]
plot 'KUMBHZ.out' lc rgb 'red' lw 2.0 with fsteps,\
'finalmod' lc rgb 'cyan' lw 2.0 with fsteps,\
'modl.out' lc rgb 'navy' lw 2.0 with fsteps,
reset
set size ratio 0.9
set style data points
set xtics 0,10
set border lw 1.5
set ytics 0,0.5
set x2label "Period (s)" offset 1
set ylabel "Group Velocity (km/s)" offset 1
set xrange [10:102]
set yrange [2.5:4.5]
set label 3 at 80,3
set label 3 "C1 (LHMI)" center font "Times, 16"
unset key
set lmargin at screen 0.42
set rmargin at screen 0.8
set bmargin at screen 0.33
set tmargin at screen 0.9
plot 'DSP.out' lc rgb 'red' lw 2.0 with lines,\
'weig' lc rgb 'cyan' lw 2.0 with lines,\
'disp.d' lc rgb 'navy' lw 2.0 with lines,\
'weig.eror' w yerrorbar pt 0 lc black
unset multiplot
I have similar data of total 8 images of which two is shown above. I want 8 images should set on one window.
Upvotes: 0
Views: 61
Reputation: 1447
Did you type help multiplot
in gnuplot?
In general, you need more options in multiplot. Start with:
set multiplot layout 2,4 margins 0.04, 0.98, 0.08, 0.98 spacing 0.03,0.02
The layout 2,4
option will give you 2 rows and 4 columns of graphs. Or, you may wish layout 4,2
. margins
defines margins around all the graphs. spacing
defines the space between graphs. I have them pretty small in this example because I pulled this off some work I did where all the graphs had the same axis so I have labels only on the bottom and left charts.
Upvotes: 2