Box widths in bar charts
Script
set multiplot
set nodisplay
width=7
gold_ratio = 1/((1+sqrt(5))/2)
set width width
set xrange [0.1:10.4]
set yrange [0:1.1]
set nokey
# Plot 0 (bottom left)
set xlabel 'x'
set ylabel 'y'
set label 1 '(a)' 8.2,0.9
plot 'example7.dat' with boxes
# Plot 1 (bottom right)
set origin 1*width, 0*width*gold_ratio
set xlabel 'x'
set ylabel 'linkaxis 0'
set label 1 '(b)' 8.2,0.9
plot 'example7.dat' with wboxes
# Plot 2 (top left)
set origin 0*width, 1*width*gold_ratio
set xlabel 'linkaxis 0'
set ylabel 'y'
set boxwidth 0.4
set label 1 '(c)' 8.2,0.9
plot 'example7.dat' with boxes fc 2
# Plot 3 (top right)
set origin 1*width, 1*width*gold_ratio
set xlabel 'linkaxis 1'
set ylabel 'linkaxis 2'
set boxwidth 0.0
set boxfrom 0.5
set samples 40
set label 1 '(d)' 8.2,0.9
plot sin(x)*sin(x) with boxes fc 3 c 1, \
cos(x)*cos(x) with boxes fc 2 c 1
set display
refresh
Notes
This example demonstrates different ways of specifying the widths of bars on a bar chart. In panel (a), the widths are automatically determined from the data, changing bar midway between datapoints. In panel (b), the wboxes plot style is used, which reads the widths of the bars from a third column in the datafile. In panel (c), we demonstrate how the set boxfrom command can be applied to bar charts, as well as to impulses. And in panel (d) we illustrate how the fillcolour modifier can be used to produce coloured bars.