time$ Returns current time. date$ Returns current date. left$(string$,4) Returns the first three characters of expression ‘str$’. right$(str$,4) Returns the characters of ‘str$’ from the fourth letter. seg$(string$,2,5) Returns the characters from the second to the fifth. num$(4) Text representation of ‘4’. num1$(4) As above but with no spaces. val(string$) Value of string ‘string$’. pos(string1$,sting2$,exp) Position of ‘string2$’ in ‘string1$’ from position ‘exp’. len(string$) Returns the length of ‘string$’.
abs(exp) Absolute value of ‘exp’. acosh(exp) Inverse hyperbolic cosine of ‘exp’. acot(exp) Inverse cotangent of ‘exp’. acoth(exp) Inverse hyperbolic cotangent of ‘exp’. acsc(exp) Inverse cosecant of ‘exp’. acsch(exp) Inverse hyperbolic cosecant of ‘exp’. asec(exp) Inverse secant of ‘exp’. asech(exp) Inverse hyperbolic secant of ‘exp’. asinh(exp) Inverse hyperbolic sine of ‘exp’. atn(exp) Arctangent of ‘exp’. atanh(exp) Inverse hyperbolic tangent of ‘exp’. cos(exp) Cosine of ‘exp’. cosh(exp) Hyperbolic cosine of ‘exp’. cot(exp) Cotangent of ‘exp’. coth(exp) Hyperbolic cotangent of ‘exp’. csc(exp) Cosecant of ‘exp’. csch(exp) Hyperbolic cosecant of ‘exp’. exp(exp) Exponent of ‘exp’. fix(exp) ‘exp’ rounded towards zero. int(exp) Interger part of ‘exp’. log(exp) Log to the base e of ‘exp’. log10(exp) Log to the base 10 of ‘exp’. sec(exp) Secant of ‘exp’. sech(exp) Hyperbolic secant of ‘exp’. sgn(exp) Returns +1 if ‘exp’ is positive and -1 if ‘exp’ is negative. sin(exp) Sine of ‘exp’. sinh(exp) Hyperbolic sine of ‘exp’. sqr(exp) ‘exp’ squared. tan(exp) Tangent of ‘exp’. tanh(exp) Hyperbolic tangent of ‘exp’. todeg(exp) Converts radians to degrees. torad(exp) Converts degrees to radians. not(exp) Logical not of ‘exp’. rnd(exp) Random number generated from seed ‘exp’. sqrt(exp) Square root of ‘exp’.
xend() The x coordinate of the end of a drawn text string. yend() The y coordinate of the end of a drawn text string. xpos() The current x coordinate. ypos() The current y coordinate. twidth(string$) The width of ‘string$’ in the current font. theight(string$) The height of ‘string$’ in the current font. tdepth(string$) The depth of ‘string$’ in the current font. xg(xexp) The x coordinate ‘xexp’ on the last graph. yg(xexp) The y coordinate ‘xexp’ on the last graph.
^{} Superscript _{} Subscript \\ Forced Newline \_ Underscore character \, .5em (em = width of the letter `m') \: 1em space \; 2em space \char{22} Any character in current font \chardef{a}{hello} Define a character as a macro \def\v{hello} Defines a macro \movexy{2}{3} Moves the current text point \glass Makes move/space work on beginning of line \rule{2}{4} Draws a filled in box, 2cm by 4cm \setfont{rmb} Sets the current text font \sethei{.3} Sets the font height (in cm) \setstretch{2} Scales the quantity of glue between words \lineskip{.1} Sets the default distance between lines of text \linegap{-1} Sets the minimum required gap between lines
The remaining characters are shown in the diagrams below
rm Roman rmb Roman Bold rmi Roman Italic ss San Serif ssb San Serif Bold ssi San Serif Italic tt Typewriter ttb Typewriter Bold tti Typewrite Italic
texcmb Computer Modern Bold texcmex Computer Modern Extensible texcmitt Computer Modern Italic Typewriter texcmmi Computer Modern Maths Italic texcmr Computer Modern Roman texcmss Computer Modern Sans Serif texcmssb Computer Modern Sans Serif Bold texcmssi Computer Modern Sans Serif Italic texcmsy Computer Modern Symbol texcmti Computer Modern Text Italic texcmtt Computer Modern Typewriter Text
plba Block Ascii plcc Complex Cartographic plcg Complex Gothic plci Complex Italic plcr Complex Roman plcs Complex Script pldr Duplex Roman plge Gothic English plgg Gothic German plgi Gothic Italian plsa Simplex Ascii plsg Simplex German plsr Simplex Roman plss Simplex Script plsym1 Symbols one plsym2 Symbols two plti Triplex Italic pltr Triplex Roman
psagb AvantGarde-Book psagbo AvantGarde-BookOblique psagd AvantGarde-Demi psagdo AvantGarde-DemiOblique psbd Bookman-Demi psbdi Bookman-DemiItalic psbl Bookman-Light psbli Bookman-LightItalic psc Courier pscb Courier-Bold pscbo Courer-BoldOblique psco Courier-Oblique psh Helvetica psgb Helvetica-Bold pshbo Helvetica-BoldOblique psho Helvetica-Oblique pshc Helvetica-Condensed pshcb Helvetica-Condensed-Bold pshcbo Helvetica-Condensed-BoldOblique pshn Helvetica-Narrow pshnb Helvetica-Narrow-Bold pshnbo Helvetica-Narrow-BoldOblique pshno Helvetica-NarrowOblique psncsb NewCenturySchlbk-Bold psncsbi NewCenturySchlbk-BoldItalic psncsi NewCenturySchlbk-Italic psncsr NewCenturySchlbk-Roman pspb Palatino-Bold pspbi Palatino-BoldItalic pspi Palatino-Italic pspr Palatino-Roman pstr Times-Roman psti Times-Italic pstb Times-Bold pstbi Times-BoldItalic pszcmi ZapfChancery-MediumItalic pszd ZapfDingbats pssym Symbol
Indicates the start of a comment within a program script. GLE will ignore everything from the exclamation mark to the end of line. It is best not to place comments on the same line as a text
or similar command, as the exclamation mark is treated as part of the text.
Executes the subroutine xxx
. Subroutines should be defined at the start of a programming script.
Draws a line from the current point to the absolute coordinates (x,y). The optional qualifiers will add an arrow head to the line, the size of this head is defined by the current font size, not by the line-width.
Moves to the absolute coordinates (x,y).
Draws an arc of a circle of given radius centred on the current coordinate point. The arc is drawn in an anti-clockwise direction from and angle a1
to and angle a2
, with both angles in degrees.
Draws a line from the current point to (x1,y1) then to (x2,y2), but with an arc of radius rad
replacing the vertex at (x1,y1).
Draws a box around everything between the commands begin box
and end box
. The add
option places an extra margin, of gap
cm, around the graphics within the box commands. The nobox
option removes the outline of the box. The name
command is used when we wish to refer again to the box in a subsequent join
command.
This saves the region between the commands begin clip
and end clip
for use with the begin path clip
command.
Sets the current point to behave like the origin, (0,0), all commands placed between the two commands begin origin
and end origin
will be referred to this point. The command is useful when calling subroutines or when drawing something with aline
and amove
commands.
Initializes the drawing of a filled shape. All the lines and curves generated from begin path
to the next end path
command will be stored and then used to draw the shape. Stroke
draws the outline of the shape, fill
paints the inside of the shape in the given colour, and clip
defines the region as a clipping region for use with the begin clip
command.
The coordinate system is rotated anti-clockwise about the current point an angle given in degrees.
Scales the commands between begin scale
and end scale
by fractions x in the x direction and y in the y direction.
This module is an alternative to the begin text
module. It reads the spaces and tabs in the source file and aligns the words accordingly.
This module allows multiple lines of text to be displayed. The text within the module will be displayed with the line breaks and spaces as it appears in the script, if a width
option is also present then the text will wrap around at this width. We can set the justification, font, and size with a previous set
command. Within the block of text we are free to use many of the special characters produced using LaTeX commands.
All the graphics within the translate block are moved by x units to the right and y units up.
Draws a cubic Bezier section (3rd degree polynomial) from the current point to the point (x3,y3), with control points at (x1,y1) and (x2,y2).
Reads the file ‘filename.gle’ and executes it line by line, this saves on memory and allows a file of any size to be run, but some complex multi-line commands are not available.
Draws a box of width x and height y. The box is positioned with the justify
command according to the standard GLE handles, TL for top-left, CB for centre-bottom, etc. The name
option is for later use with the join
command, and the nobox
option removes the outline of the box.
Draws a circle of given radius centred on the current coordinate point.
Joins the current point to the beginning of the path.
Draws a smooth curve through the points [x1 y1 x2 y2 x3 y3 ... xn yn] with intial gradient (ix,iy) and final gradient (ex,ey).
This defines a new marker called ‘markername’ which will call the subroutine ‘subroutine-name’ whenever it is used. It passes two parameters, the first is the size of the marker and the second is a value from a secondary dataset which can vary the size or rotation of each marker plotted.
The for...next
structure repeats the commands contained within the block to be repeated while the for
expression is still valid.
Restores the most recently saved graphic state. It must be paired with a gsave
command.
Saves the current graphic state including the current graphics transformation matrix, the current point and the current font and colour settings.
If exp
is evaluated to be true then the commands following then
are executed, if it is false then the commands following else
are executed. Either way normal program execution resumes after the end if
command. Note that end if
is not spelt endif
.
The commands in the file ‘filename’ are read just as they would if they were written out in the program script. This can help simplify complex programs and also allow common routines to be easily recycled.
Joins two objects that have been named with either name
commands or the save
command. .just
is the justification that controls which point on the object is used. sep
can be -
for a single line, ->
for a single arrow, or <->
for a double arrow.
Draws the marker ‘marker-name’ at the current point. The marker size is proportional to the current font size but scaled by the factor [scale factor]
. There are a number of preset markers in GLE but additional ones can be defined with the define marker
command.
Includes an encapsulated postscript file into a GLE graphic. The postscript picture will be scaled according to the width supplied such that the aspect ratio is maintained, the height supplied is used to draw a rectangle on the screen.
Identical to the bezier
command except the points given are relative to the current coordinate point.
Reverses the direction of the current path, this is useful when we are drawing complex objects and need to indicate which part of the object is to be considered the ‘inside’.
Draws a line form the current point to the relative coordinate (x,y), which then becomes the current point. The optional qualifiers at the end will draw arrow heads at one or both of the line ends; the size of the arrow head is proportional to the current font size.
Moves to the relative coordinate (x,y).
Saves the current point for use with a subsequent join
command.
Determines the appearance of the end of a wide line
Sets the colour for use with all future drawing commands.
Sets the length of the smallest dash length that appears in the various line styles.
Sets the current font, a list of valid font names is given in the appendix.
Sets the width of the lines in stroked (Plotter) fonts.
Controls what happens at the join between two thick lines. For the command to work the lines must form part of a continuous path.
Controls the positioning of objects and text in relation to the current coordinate point.
Sets the line style for all subsequent lines.
Sets the line width in cm for all subsequent lines.
Defines a subroutine ‘subname’, all commands between the sub
command and the end sub
command will form part of the subroutine and can be executed at any point using the @sub-name
command. The parameters are local variables for use within the subroutine and do not affect the variables defined in the program body.
Prints text to the screen.
Prints the text variable ‘string$’ to the screen.
Outputs the x and y coordinates of the point at x=948 and y=0.04 of the last graph drawn.
Moves to the end of the last thing drawn.
The x and y coordinates of the current point.
Draws a bar chart of the dataset d4, the bars are separated by a distance specified by the dist
option.
Creates a stacked bar chart of the datasets dx,... ontop of dy,....
Creates a grouped chart of the datasets dn,.... Each dataset has format options separated by commas and in the same order as the dataset list.
Reads the data from the file ‘filename’ into the datasets [d1 d2 d3 ...], by default the datasets will contain the first and second columns , the first and third, the first and forth, etc. We can specify which columns are read into which dataset using the d1=c1,c3 option, which will, for example, read the first and third column into the dataset d1.
In general we can refer to a dataset either by its number, d2
for example, or we can refer to all datasets using the label dn
. In the commands that follow we shall use dn
to control the formatting of all of the datasets. In each case we can replace dn
with a the label for a single dataset.
This plots the data from the file ‘all.dat’ point by point. The operation uses less memory than the data
command but some of the more complex commands are unavailable.
Adds either absoulte or relative vertical error bars to the dataset dn. errwidth
controls the width of the terminating line.
Similar to the err
command but the error bars are horizontal.
Adds a dataset to the key, see the key
command for the various format options that control the appearence of the key.
Draws a series of straight lines connecting the data points that comprise the dataset.
Sets the line style for any connecting lines of the dataset.
Adds markers at each point in the dataset. The mdata
command allows us to pass parameters to a marker defined with a subroutine.
Connects all points in the dataset dn, even if there are one or more missing values.
Draws a smooth (3rd degree polynominal) through the points in the dataset, smoothm
is used for a dataset with multiple y values for each x point.
Controls the maximum and minimum plotted values of the dataset.
Fills with colour col
the area between two datasets, or between a dataset and one of the axes.
Command shortcut that sets the vertical and horizontal scales to 1 and removes the bounding box.
Scales the horizontal width of the graph compared with the width defined in the size
command. The default is 0.7 (70%).
Controls the various formatting options available for the key.
Creates a dataset, ds, from an algebraic expression that may, or may not, be a function of other datasets.
Removes the box that, by default, surrounds any graph drawn with the graph module.
Sets the size of the graph within the main GLE page.
Adds a title to the graph, dist
sets the vertical positioning of the title.
size
command. The default is 0.7 (70%).Prints the labels on the upper x-axis.
Each of the four axes can be formatted individually, in the following we shall look only at the x-axis commands, though a similar set of commands exists for the second x-axis and the two y-axes.
Controls the formatting of the x-axis.
Sets the spacing of the subticks.
Makes the ticks and subticks cover the entire graph to create a grid.
Uses a logarithmic scale for the x-axis.
Sets the maximum and minimum displayed values on the x-axis. dpoints
sets the number of decimal places displayed in the labeling.
Removes the first or last label from a graph.
Sets either the number of ticks or spacing between ticks on the x-axis.
Turns off the x-axis.
Moves the labeling on the x-axis to the left or right.
Formats the labels on the x-axis.
Adds the given labels to the x-axis. Use the xplaces
command to set the spacing of the labels.
Replaces the default labels with labels at pos1
, pos2
, pos3
and so on.
Formats the appearance of the axis line itself.
Formats the appearance of the x-axis subticks. xsubticks off
will turn them off altogether.
Formats the appearance of the x-axis ticks.
adds a title to the x-axis.
Rotates the right-hand y-axis by 180°.
Sets the position of the key as measured from the bottom left hand corner of the graph.
Sets the position of the key according to the standard GLE justify handles.
This is the text that will be displayed in the key.
Controls the line style drawn on one line of the key.
Sets the marker to appear on one line of the key.
Sets the marker size.
Sets the factor that the marker is scaled by.
Controls the colour of the title, line and marker.
Sets the text height used in the key.
Controls the fill style used on one line of the key.
The GLE wall chart, with marker and line styles and some of the common fonts. For reference here is the program code,
!wall.gle - Wall chart for gle !Original code by Chris Pugmire (I think) size 17 26 box ! this is for sticking on your wall ! it has fonts, lstyles, shading, colors, markers on it. set hei 1 just center font plge amove 9 24.5 !25.5 text CGLE Wall Reference set just left set hei .3 amove .3 .4 text wall.gle amove 2 4 sub sh f$ set just left box -.5 .5 fill f$ RMOVE .2 .1 write f$ rmove -.2 .4 end sub amove 9.5 10 set hei .3 font ss begin box add .2 begin text width 7 The GRID and SHADE patterns should only be used for filling on PostScript printers, the grey levels and colors will work for both filling and color settings on any device. end text end box set font rm set hei .4 amove 11.5 2 @sh "Shade" @sh "Shade1" @sh "Shade2" @sh "Shade3" @sh "Shade4" @sh "Shade5" @sh "Grid" @sh "Grid1" @sh "Grid2" @sh "Grid3" @sh "Grid4" @sh "Grid5" amove 14.5 2 @sh "Red" @sh "Green" @sh "Blue" @sh "Magenta" @sh "Yellow" @sh "Black" @sh "White" @sh "Grey1" @sh "Grey5" @sh "Grey10" @sh "Grey20" @sh "Grey90" sub mm name$ gsave mk = mk+1 gsave set lwidth .0001 set lstyle 1212 rmove 0 .4 rline 0 -.8 rmove 0 .4 grestore marker name$ 1 rmove .3 0 rline .5 0 rmove .2 -.15 write name$ grestore rmove 0 -.65 end sub amove 9.5 22 @mm "circle" @mm "triangle" @mm "square" @mm "diamond" @mm "fcircle" @mm "ftriangle" @mm "fsquare" @mm "fdiamond" @mm "dot" @mm "cross" @mm "club" @mm "heart" @mm "star" @mm "snake" amove 13.5 22 @mm "dag" @mm "ddag" @mm "asterisk" @mm "oplus" @mm "ominus" @mm "otimes" @mm "odot" @mm "trianglez" @mm "diamondz" @mm "wcircle" @mm "wtriangle" @mm "wsquare" @mm "wdiamond" sub fnt f$ n$ set font rm set just right write f$ rmove .5 0 set just left font f$ write n$ rmove -.5 -.6 end sub set hei .4 amove 2 14 @fnt "rm" "Roman" @fnt "rmi" "Roman Italic" @fnt "rmb" "Roman Bold" @fnt "rmbi" "Roman Bold Italic" @fnt "tt" "Typewriter" @fnt "ttb" "Typewriter Bold" @fnt "ss" "Sans Serif " @fnt "ssb" "Sans Serif Bold" @fnt "ssi" "Sans Serif Italic" @fnt "psc" "PostScript Courier" @fnt "psh" "PostScript Helvetica" @fnt "psbd" "PostScript Bookman Demi" @fnt "psncsr" "PostScript New Century Schlblk Roman" @fnt "pszcmi" "PostScript ZapfChancery-MediumItalic" @fnt "pszd" "PostScript ZapfDingbats" @fnt "pltr" "Plotter Triplex Roman" @fnt "pldr" "Plotter Duplex Roman" @fnt "plsr" "Plotter Simplex Roman" @fnt "plge" "Plotter Gothic English" @fnt "plci" "Plotter Complex Italic" @fnt "plss" "Plotter Simplex Script" amove 2 20 box 6 3 begin origin set hei .3 just left font rm amove .5 2.5 for z = 0 to 4 set lstyle z rline 2 0 rmove .1 0 write z rmove -2.1 -.4 next z amove 3.5 2.5 for z = 5 to 9 set lstyle z rline 2 0 rmove .1 0 write z rmove -2.1 -.4 next z amove .5 .2 set lstyle 9229 rline 3 0 rmove .1 0 text 9229 end origin sub lw ww wn$ set lwidth ww rline 1 0 rmove .2 -.1 write wn$ rmove -1.2 .5 end sub set hei .3 just left font ss amove 3 16 @lw 0 "lwidth 0" @lw .0001 "lwidth 0.0001" @lw .01 "lwidth 0.01" @lw .02 "lwidth 0.02" @lw .05 "lwidth 0.05" @lw .1 "lwidth 0.1" @lw .2 "lwidth 0.2"