Back to demo index

gnuplot demo script: layout.dem

autogenerated by webify.pl on Tue Feb 5 14:02:10 2013
gnuplot version gnuplot 4.7 patchlevel 0
#
# Gnuplot version 4.1 demo of multiplot
# auto-layout capability
#
#
set multiplot layout 3, 1 title "Multiplot layout 3, 1" font ",14"
set tmargin 2
set title "Plot 1"
unset key
plot sin(x)/x
#
set title "Plot 2"
unset key
plot 'silver.dat' using 1:2 ti 'silver.dat'
#
set style histogram columns
set style fill solid
set key autotitle column
set boxwidth 0.8
set format y "    "
set tics scale 0
set title "Plot 3"
plot 'immigration.dat' using 2 with histograms, \
     '' using 7  with histograms , \
     '' using 8  with histograms , \
     '' using 11 with histograms 
#
unset multiplot
#
#
#

Click here for minimal script to generate this plot



set multiplot layout 1,3 title "Multiplot layout 1, 3" font ",14"
set xtics rotate
set bmargin 5
#
set title "Plot 1"
unset key
plot sin(x)/x
#
set title "Plot 2"
unset key
plot 'silver.dat' using 1:2 ti 'silver.dat'
#
set title "Plot 3"
set style histogram columns
set style fill solid
set key autotitle column
set boxwidth 0.8
set format y "    "
set tics scale 0
plot 'immigration.dat' using 2 with histograms , \
     '' using  7 with histograms , \
     '' using  8 with histograms , \
     '' using 11 with histograms 
#
unset multiplot
#
#
#
#

Click here for minimal script to generate this plot



set multiplot layout 1,3 title "Same plot with a multi-line title\nshowing adjustment of plot area\n to accommodate it" font ",14"
set xtics rotate
set bmargin 5
#
set title "Plot 1"
unset key
plot sin(x)/x
#
set title "Plot 2"
unset key
plot 'silver.dat' using 1:2 ti 'silver.dat'
#
set title "Plot 3"
set style histogram columns
set style fill solid
set key autotitle column
set boxwidth 0.8
set format y "    "
set tics scale 0
plot 'immigration.dat' using 2 with histograms , \
     '' using  7 with histograms , \
     '' using  8 with histograms , \
     '' using 11 with histograms 
#
unset multiplot

Click here for minimal script to generate this plot



#
#          Stacked Plot Demo
#
# Set top and bottom margins to 0 so that there is no space between plots.
# Fix left and right margins to make sure that the alignment is perfect.
# Turn off xtics for all plots except the bottom one.
# In order to leave room for axis and tic labels underneath, we ask for
# a 4-plot layout but only use the top 3 slots.
#
set tmargin 0
set bmargin 0
set lmargin 3
set rmargin 3
unset xtics
unset ytics

set multiplot layout 4,1 title "Auto-layout of stacked plots\n" font ",12"

set key autotitle column nobox samplen 1 noenhanced
unset title
set style data boxes
set yrange [0 : 800000]

plot 'immigration.dat' using 3 lt 1
plot 'immigration.dat' using 8 lt 3
set xtics nomirror
set tics scale 0 font ",8"
set xlabel "Immigration to U.S. by Decade"
plot 'immigration.dat' using 21:xtic(1) lt 4

unset multiplot

Click here for minimal script to generate this plot



#
#          Stacked Plot Demo Continued
#
# Another option is to expand the (N-1)th plot to fill 
# additional space
#
unset xlabel
unset xtics
unset ytics

set multiplot layout 6,1 title "Expanding one of the plots to use additional space\n" font ",12"

set key autotitle column nobox samplen 1 noenhanced
unset title
set style data boxes
set yrange [0 : 800000]

plot 'immigration.dat' using 3 lt 1
plot 'immigration.dat' using 8 lt 3
plot 'immigration.dat' using 21 lt 4
set xtics nomirror
set tics scale 0 font ",8"
set xlabel "Immigration to U.S. by Decade"

# Override automatic calculation of lower plot boundary
set bmargin at screen 0.1
set yrange [0:*]
plot 'immigration.dat' using ($3+$8+$21):xtic(1) lt 9 title "Total"

unset multiplot

Click here for minimal script to generate this plot