Search code examples
gnuplot

Gnuplot: how to make scales stick to each graph in multiplot


I have this code:

set size 1, 1
set origin 0.0, 0.0
set term postscript eps enhanced color 'Helvetica' 25
set output 'sig_tau3.eps'
set multiplot layout 2,2
set style fill solid 1.0 noborder
set size square
set xtics ("0" 0, "175" 175, "350" 350) font "Helvetica,40"
set ytics ("0" 0, "2" 2, "4" 4) font "Helvetica,40"
set cbtics ("-0.0075" -0.0075, "0" 0, "0.0075" 0.0075) font "Helvetica,40"
set xlabel "{/Symbol t}" font "Helvetica,40"
set label "{/Symbol s}" font "Helvetica,40" at graph -0.3, graph 0.6
set label "{Re{/Symbol z}_{max}}" font "Helvetica,40" at graph 1.25, graph 0.5
set pm3d map #Achte auf das Format der Datendatei (Leerzeilen!)
set cbrange [-0.0075:0.0075]
set xrange [0:350]
set yrange [0:4]
set palette defined (-0.0075 0 0 1, 0 0 1 0, 0 "yellow", 0.0075 1 0 0)
set colorbox
unset key
splot "1.dat" u 1:2:4 title""

unset xtics
unset ytics
unset cbtics
unset xlabel
unset label
unset label
unset cbrange
unset xrange
unset yrange
unset pm3d map 
unset palette defined
unset set colorbox 

set xtics ("0" 0, "175" 175, "350" 350) font "Helvetica,40"
set ytics ("0" 0, "6" 6, "12" 12) font "Helvetica,40"
set cbtics ("-0.0075" -0.0075, "0" 0, "0.0075" 0.0075) font "Helvetica,40"
set xlabel "{/Symbol t}" font "Helvetica,40"
set label "{/Symbol s}" font "Helvetica,40" at graph -0.3, graph 0.6
set label "{Re{/Symbol z}_{max}}" font "Helvetica,40" at graph 1.25, graph 0.5
set pm3d map #Achte auf das Format der Datendatei (Leerzeilen!)
set cbrange [-0.0075:0.0075]
set xrange [0:350]
set yrange [0:12]
set palette defined (-0.0075 0 0 1, 0 0 1 0, 0 "yellow", 0.0075 1 0 0)
set colorbox
unset key
splot "4.dat" u 1:2:4 title""
unset multiplot

which provides me with this plot: enter image description here

The only issue here is the scales. How can I have them stick to each graph?

I tried to solve this issue but I could not find the right command.


Solution

  • Please remember to always tell the gnuplot version you are working with. I infer you must be using a very old version because the commands set pm3d map and unset pm3d map were deprecated in the change from version 4 to version 5 (2015).

    I am not entirely sure I understand your question, but the most obvious issue with your output plot is that the font size is too large.

    The default output (paper) size for the eps terminal in gnuplot is 5.0in x 3.0in. The default size in your older version may be different (I seem to recall 5.0 x 3.5). Typically on such a small area one would choose a font size about 10pt. You have requested instead font sizes of 25pt and 40pt, which are very large.

    You have several options for correcting this mis-match.

    1. You could choose a smaller font, i.e. font "Helvetica,12" rather than font "Helvetica,40". I think this should work for any gnuplot version.

    2. You could keep the font sizes but request a larger output paper size. This command may be different in very old gnuplot versions, but in version 5 it would be something like set term postscript eps size 10in,7in

    3. In recent gnuplot versions there is an option to rescale all the fonts. I do not recall how old this option is but probably versions older than 5.0 do not have it. For this you would keep the default terminal size and the requested font sizes as they are, but add to the "set term" command set term postscript eps color enhanced font "Helvetica,25" fontscale 0.5.

    enter image description here