#
# Example of using histogram modes
#
reset
set title "US immigration from Europe by decade"
set datafile missing "-"
set xtics nomirror rotate by -45
set key noenhanced
#
# 'newhistogram' keyword to plot
#
set title "Default Histogram Colouring"
set key under
set key invert autotitle columnhead
set style data histogram
set style histogram clustered gap 1 title offset 2,0.25
set style fill solid noborder
set boxwidth 0.95
unset xtics
set xtics rotate by -45
set xlabel "Immigration from different regions" offset 0,-3
set ytics
set grid y
set auto y
set bmargin 10
#
plot \
newhistogram "Northern Europe", \
'immigration.dat' using 6:xtic(1), '' u 13, '' u 14, \
newhistogram "Southern Europe", \
'' u 9:xtic(1), '' u 17 , '' u 22 , \
newhistogram "British Isles", \
'' u 10:xtic(1) , '' u 21 
#
pause -1 "Same plot using explicit histogram start colors"
set title "Explicit start color in 'newhistogram' command"
plot \
newhistogram "Northern Europe" lt 4, \
'immigration.dat' using 6:xtic(1), '' u 13, '' u 14, \
newhistogram "Southern Europe" lt 4, \
'' u 9:xtic(1), '' u 17, '' u 22, \
newhistogram "British Isles" lt 4, \
'' u 10:xtic(1), '' u 21
#
#
pause -1 "Same plot using explicit histogram start pattern"
set title "Explicit start pattern in 'newhistogram' command"
set style fill pattern 1 border -1
plot \
newhistogram "Northern Europe" fs pattern 1, \
'immigration.dat' using 6:xtic(1), '' u 13, '' u 14, \
newhistogram "Southern Europe" fs pattern 1, \
'' u 9:xtic(1), '' u 17, '' u 22, \
newhistogram "British Isles" fs pattern 1, \
'' u 10:xtic(1), '' u 21
#
#
pause -1 "Same plot with both explicit color and pattern"
set title "Explicit start pattern and linetype"
set style fill pattern 1 border -1
plot \
newhistogram "Northern Europe" lt 2 fs pattern 1, \
'immigration.dat' using 6:xtic(1), '' u 13, '' u 14, \
newhistogram "Southern Europe" lt 2 fs pattern 1, \
'' u 9:xtic(1), '' u 17, '' u 22, \
newhistogram "British Isles" lt 2 fs pattern 1, \
'' u 10:xtic(1), '' u 21
#
#
pause -1
