! Demo about plot adjustments. ! Author: Francois Tonneau ! In this script, data from different phases will be obtained from a tab- ! delimited file. By default, GLE does not connect data points across missing ! values. So, we have used the trick of inserting missing values ('*') into ! the data file to create visual breaks across phases. size 10 8 set font ss cap round join round begin graph xaxis min -2 max 68 yaxis min -2 max 140 ftick 0 dticks 20 ! We put custom tick labels ('xnames') at custom places along the x axis ! ('xplaces'): xplaces 1 10 24 34 44 55 65 xnames 1 10 10 20 30 10 20 x2axis off y2axis off side off subticks off small = 0.1 xticks length -small yticks length small xtitle "Sessions" dist 0.3 ytitle "Responses per minute" dist 0.3 data "adjust.dat" ! Aside from named colors and the #RRGGBB notation, GLE lets us define hues ! with the rgb255() function. Each of its arguments is a number from 0 to ! 255, corresponding to the intensity of red, blue, and green. d1 line color rgb255(0,78,88) lwidth 0.03 d2 line color rgb255(205,92,92) lwidth 0.03 ! We create a custom dataset to plot a horizontal line starting at x = 15: base_level = 71 let d3 = base_level from 15 to 68 ! GLE plots graphical elements through successive layers, the layer for ! data lines being layer #700. Creating a new layer with a number < 700 ! forces the horizontal line to lie behind the data: begin layer 600 d3 line color #999999 lstyle 44 lwidth 0.025 end layer end graph set lwidth 0.025 ! The xg() and yg() functions transform axis-relative coordinates (e.g., x = 1) ! into actual centimeters. These functions are very useful for positioning an ! object on the plot, but they cannot be called directly from a graph block -- ! so we call them once the graph block is over. Here we use them to add line ! segments to the x axis: amove xg(1) yg(-2) aline xg(14) yg(-2) amove xg(15) yg(-2) aline xg(45) yg(-2) amove xg(46) yg(-2) aline xg(68) yg(-2) amove xg(-2) yg(0) aline xg(-2) yg(140) set lwidth 0.02 ! We define a custom subroutine to add special ticks to the x axis: sub add_tick place amove xg(place) yg(-2) rline 0 -small end sub add_tick 5 add_tick 19 add_tick 29 add_tick 39 add_tick 50 add_tick 60 ! We also add vertical dashed lines to separate phases from one another: set lstyle 12 amove xg(14.5) yg(0) aline xg(14.5) yg(139) amove xg(45.5) yg(0) aline xg(45.5) yg(139) ! Finally, we add custom labels to the plot: amove 2 yg(140) write "S53" amove xg(22) yg(122) write "VI" amove xg(20) yg(10) write "Ext" ! Done. We have used layers as well as the xg() and yg() functions.