! Example with stacked bars. ! Author: Francois Tonneau size 11 9 set font ss cap round amove 2 2.25 begin graph size 8 6 fullsize xaxis min -0.3 max 17.5 ftick 1 dticks 1 yaxis min 0 max 120 x2axis off y2axis off xside off xticks off ! We use the 'angle' axis subcommand to rotate x labels by 60 degrees. As ! the first column of our data file (stacks.dat) consists of non-numeric ! strings, GLE interprets them as x labels without further ado. xaxis angle 60 ysubticks length 0.07 xtitle "Ratio component (X) of tandem VI X" dist 0.3 ytitle "Responses per minute" dist 0.4 data "stacks.dat" ! GLE has different types of bar commands. A bar command such as: ! ! bar dm ! ! produces a single set of bars. ! A bar command such as: ! ! bar dm,dn ! ! produces grouped bars. ! A bar command such as: ! ! bar dn from dm ! ! produces stacked bars. In this case, however, GLE does not stack dn above ! dm; rather, GLE stacks the *difference*, dn - dm, above dm. ! Accordingly, if we want to plot d2 above d1 (as in the present example), ! we must first cumulate the two datasets. GLE allows us do this with the ! 'dn = dm...-expression' syntax. Here our expression is the sum, 'd1+d2': bar d1 width 0.9 fill lightsteelblue let d2 = d1+d2 bar d2 from d1 width 0.9 fill cadetblue end graph amove 2 2.25 rline 0.1 0 ! We conclude with plot decorations: amove 2.7 7.75 box 0.4 0.4 just bl fill cadetblue box 0.4 0.4 just tl fill lightsteelblue rmove 0.7 0 set just bl write "Key B" rmove 0 -0.08 set just tl write "Key A" ! Done. We have learned how to plot stacked bars.