Gle Manual 4.2.2
Gle Manual 4.2.2
Gle Manual 4.2.2
http://www.gle-graphics.org/
January 3, 2010
ii
Contents
1 Preface v
2 Tutorial 3
2.1 Installing GLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Running GLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Drawing a Line on a Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.4 Drawing a Simple Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 Primitives 7
3.1 Graphics Primitives (a summary) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Graphics Primitives (in detail) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
6 Programming Facilities 47
6.1 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.2 Functions Inside Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.3 Using Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.4 Programming Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.5 If-then-else . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.6 Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.6.1 Default Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.7 Forward Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.8 I/O Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.9 Device dependend Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
7 Advanced Features 55
7.1 Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
7.1.1 Named Boxes and the Join Command . . . . . . . . . . . . . . . . . . . . . . . . . 55
7.1.2 Object Blocks and Hierarchically Named Points . . . . . . . . . . . . . . . . . . . . 57
7.2 LATEX Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.2.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.2.2 Using LaTeX Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.2.3 Using UTF-8 Encoding in GLE Scripts with LaTeX Expressions . . . . . . . . . . 59
iii
iv CONTENTS
9 GLE Utilities 71
9.1 Fitls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
9.2 Manip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
9.2.1 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
9.2.2 Manip Primitives (a summary) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
9.2.3 Manip Primitives (in detail) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
A Tables 79
A.1 Markers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
A.2 Functions and Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
A.3 LATEX Macros and Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
A.4 Installing GLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
A.5 Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
A.6 Font Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
A.7 Predefined Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
A.8 Wall Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Index 97
Chapter 1
Preface
Abstract
GLE (Graphics Layout Engine) is a graphics scripting language designed for creating publication quality
graphs, plots, diagrams, figures and slides. GLE supports various graph types (function plots, histograms,
bar graphs, scatter plots, contour lines, color maps, surface plots, ...) through a simple but flexible set of
graphing commands. More complex output can be created by relying on GLE’s scripting language, which
is full featured with subroutines, variables, and logic control. GLE relies on LATEX for text output and
supports mathematical formulea in graphs and figures. GLE’s output formats include EPS, PS, PDF,
JPEG, and PNG. GLE is licenced under the BSD license. QGLE, the GLE user interface, is licenced
under the GPL license.
Trademark Acknowledgements
The following trademarks are used in this manual.
Windows Microsoft Corporation.
TEX Donald E. Knuth, A Typesetting System.
LATEX Leslie Lamport, A Document Preparation System.
PostScript Page Description Language, Adobe Systems Inc.
Typographic Conventions
The following conventions will be used in command descriptions:
[option] Specifies an optional keyword or parameter, the brackets should
not be typed.
option1 | option2 Pick one of the options listed.
keyword Keywords are represented in a bold typewriter font.
exp,x,y,x1,y1 Represent numbers or expressions. E.g. 2.2 or 2*5. Parameters
to be entered by the user are given in italics.
Pathways
For those in a hurry:
1. Read Chapter 2, The GLE Tutorial (beginners only).
2. Examine the examples at http://www.gle-graphics.org/examples/.
3. Browse through Chapter 4, The Graph Module.
For those with time:
• Chapter 2, GLE Tutorial:
Covers installation and drawing a simple graph, highly recommended if you have never used GLE
before.
• Chapter 3, GLE Primitives:
Describes the commands used for creating diagrams and slides and for annotating graphs.
v
1
Tutorial
Feel free to post any questions or comments you might have about installing GLE on the GLE mailing
list, which is available here:
gle
If this message does not appear and you see an error message instead, then GLE is not correctly installed.
Refer to the installation instructions (Appendix A.4) for more information. In the following, we will show
how to construct a simple drawing with GLE.
3
4 CHAPTER 2. TUTORIAL
√
(1, 2)
size 8 2
This specifies that the output will be 8cm wide and 2cm high. Next we define a “current point” by
moving to somewhere on the page:
amove 0.25 0.25
The origin (0,0) is at the bottom left hand corner of the page. Suppose we wish to draw a line from this
point 5 cm across and 1 cm up:
size 8 2
amove 0.25 0.25
rline 5 1
This is a relative movement as the x and y values are given as distances from the current point, alter-
natively we could have used absolute coordinates:
size 8 2
amove 0.25 0.25
aline 5.25 1.25
To draw some text on the page at the current point, use the write command:
write "Hi there"
Or, alternatively, you could include arbitrary LATEX expressions using the tex command:
tex "$(1,\sqrt{2})$"
Enter the above GLE script using a text editor and save it to disk (any editor that saves in UTF8 or ASCII
format will work). The following assumes that you have saved the file under the name “test.gle” in the
folder C:\GLE on Windows, or /home/john/gle on a Unix-like operating system. Now open a command
prompt and go to the folder where you saved the file. Then, run GLE on the file.
On Windows, you do this as follows (C:\> is the prompt):
C:\> cd C:\GLE
C:\GLE> gle test.gle
Or on Unix:
cd ~/gle
gle test.gle
Try viewing the resulting “test.eps” with a PostScript viewer such as GhostView, and compare it to
the output shown in Fig. 2.1. You can also preview it with QGLE, GLE’s graphical user interface. After
you’ve started QGLE, enter the following command at the command prompt.
2.4. DRAWING A SIMPLE GRAPH 5
gle -p test.gle
This will preview the output in the QGLE previewer window. GLE can also create PDF files. This is
accomplished by setting the output device to “pdf”.
Try viewing the resulting “test.pdf” with Acrobat Reader or similar. Other output formats supported
by GLE (eps, ps, pdf, svg, jpg, png, x11) can also be obtained with the -device command line option
(which can be abbreviated to -d). For example, to create a JPEG bitmap file, one can use:
Help about the available command line options can be obtained with:
gle -help
1,2
2,6
3,2
4,5
5,9
The data is in two columns with a comma separating each column of numbers. The following commands
will draw a simple line graph of the data.
6 CHAPTER 2. TUTORIAL
Simple Graph
size 7 4 10
begin graph 8
Output
title "Simple Graph"
6
xtitle "Time"
ytitle "Output" 4
data "test.csv" 2
d1 line marker triangle color red 0
end graph 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Time
The commands title, xtitle, and ytitle specify the graph title and the axis titles. The command data loads
the data file and the d1 command specifies how the first curve on the graph should look like. These
commands are discussed in detail in Chapter 4. Possible values for the marker option can be found on
the GLE wall reference chart in Appendix A.8.
The axis ranges can be specified with “xaxis min v0 max v1 ” and “yaxis min v0 max v1 ”. A smooth line can
be drawn through the data points by changing the d1 command to: “d1 line smooth” as in the following
example.
Output
xtitle "Time" 6
ytitle "Output" 4
data "test.csv"
2
yaxis min 0 max 10
d1 line smooth color red 0
1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
end graph
Time
Note that the order of the commands is not important, except that circle is a parameter for the option
marker and therefore must come right after it. The same holds for line and smooth and color and blue in
the example “d1 marker circle line smooth color blue”.
It is simple to change to a bar graph and include last year’s measurements:
size 7 4 Bar Graph
begin graph 10
title "Bar Graph" Year 2000
8
Year 2001
Output
xtitle "Measurement"
6
ytitle "Output"
data "year-2000.csv" 4
data "year-2001.csv" 2
key pos tl 0
bar d1,d2 fill red,blue 1 2 3 4 5
end graph Measurement
Adding min and max values on the axis commands is highly recommended because by default GLE won’t
start from the origin unless the data happens to be very close to zero. It is also difficult to compare
graphs unless they all have the same axis ranges. More information about the graph module is available
in Chapter 4.
Chapter 3
Primitives
A GLE command is a sequence of keywords and values separated by white space (one or more spaces
or tabs). Each command must begin on a new line. Keywords may not be abbreviated, the case is not
significant. All coordinates are expressed in centimeters from the bottom left corner of the page.
GLE uses the concept of a current point which most commands use. For example, the command aline
2 3 will draw a line from the current point to the coordinates (2,3).
The current graphics state also includes other settings like line width, colour, font, 2d transformation
matrix. All of these can be set with various GLE commands.
7
8 CHAPTER 3. PRIMITIVES
The command narc is identical but draws the arc in the clockwise direction. This is important when
constructing a path.
amove .5 .5
rline 1 .5 arrow end
arc 1 10 160
arc .5 -90 0
arcto x1 y1 x2 y2 rad
Draws a line from the current point to (x1,y1) then to (x2,y2) but fits an arc of radius rad joining
the two vectors instead of a vertex at the point (x1,y1).
amove 1.5 .5
rline 1 0
set lwidth .1
arcto 2 0 -1 1 .5
set lwidth 0
rline -1 1
begin clip
This saves the current clipping region. A clipping region is an arbitrary path made from lines and
curves which defines the area on which drawing can occur. This is used to undo the effect of a
clipping region defined with the begin path command. See the example CLIP.GLE in appendix B
at the end of the manual.
begin origin
This makes the current point the origin. This is good for subroutines or something which has been
drawn using amove,aline. Everything between the begin origin and end origin can be moved as one
unit. The current point is also saved and restored.
begin rotate 90
text This is
end rotate
begin scale x y
Everything between the begin and end is scaled by the factors x and y. E.g., scale 2 3 would make
the picture twice as wide and three times higher.
begin scale 3 1
begin rotate 30 is
text This is is
h
end rotate T
end scale
begin table
This module is an alternative to the TEXT module. It reads the spaces and tabs in the source file
and aligns the words accordingly. A single space between two words is treated as a real space, not
an alignment space.
With a proportionally spaced font columns will line up on the left hand side but not on the right
hand side. However with a fixed pitch font, like tt, everything will line up.
3.2. GRAPHICS PRIMITIVES (IN DETAIL) 11
begin table
Here is my table
of text see how
Here is my table
22 44 55 33 of text see how
0.1 999 1 .2 22 44 55 33
3 33 2 33 0.1 999 1 .2
3 33 2 33
it lines up it lines up
end table
begin translate x y
Everything between the begin and end is moved x units to the right and y units up.
12 CHAPTER 3. PRIMITIVES
bezier x1 y1 x2 y2 x3 y3
Draws a Bézier cubic section from the current point to the point (x3,y3) with Bézier cubic control
points at the coordinates (x1,y1) and (x2,y2). For a full explanation of Bézier curves see the
PostScript Language Reference Manual.
box x y [justify jtype] [fill color] [name xxx] [nobox] [round val]
Draws a box, of width x and height y, with its bottom left corner at the current point. If the justify
option is used, the box will be positioned relative to the specified point. E.g., TL = top left, CC
= center center, BL = bottom left, CENTER = bottom center, RIGHT = bottom right, LEFT =
bottom left. See set just for a description of justification settings.
If a fill pattern is specified, the box will be filled. Remember that white fill is different from no fill
pattern - white fill will erase anything that was inside the box.
If the round option is used, a box with rounded corners will be drawn.
closepath
Joins the beginning of a line to the end of a line. I.e., it does an aline to the end of the last amove.
colormap fct xmin xmax ymin ymax pixels-x pixels-y width height [color] [palette pal]
Draws a colormap of the function fct(x, y), in which x ranges from xmin to xmax, and y ranges
from ymin to ymax. The size of the colormap is width by height centimeter and the resolution is
pixels-x by pixels-y pixels. A colormap is grayscale by default; it is drawn in color if the option
color is given. In the latter case, it is possible to specify a palette subroutine pal mapping the range
0 . . . 1 to a range of colors. This command is similar to the colormap command in a graph block
(Sec. 8.5).
amove 1 1
curve 1 0 0 1 1 0 0 -1 1 0
amove 3.6 1
curve 0 1 0 1 1 0 0 -1 0 -1
The second parameter can be supplied using the mdata command when drawing a graph, this gives
the marker subroutine a value from another dataset to use to draw the marker. For example the
marker could vary in size, or angle, with every one plotted.
d3 marker myname mdata d4
• If var is greater than exp2 then GLE commands are skipped until the line after the next
statement.
• The value exp3 is added to var.
• The statements between the for and next statement are executed.
grestore
Restores the most recently saved graphics state. This is the simplest way to restore complicated
transformations such as rotations and translations. It must be paired with a previous gsave com-
mand.
gsave
Saves the current graphics transformation matrix and the current point and the current colour, font
etc.
amove 3 3
if xpos()=3 then
text We are at x=3
else
text We are elsewhere
end if
include filename
Includes the GLE script “filename” into the current script. This is useful for including library scripts
with subroutines. GLE searches a number of predefined directories for include files. By default,
this includes the current directory and the “lib” or “gleinc” subdirectory of the root directory
(GLE TOP) of your GLE installation. The latter includes a number of subroutine files that are
distributed with GLE (Table 3.1). Additional include directories can be defined by means of the
environment variable GLE USRLIB.
Figure 3.1: All markers supported by GLE. (The names that start with “w” are white filled.)
Arrow heads can be included at both ends of the line by writing sep as <->. Single arrow heads
are produced by <- and ->. Note that sep must be separated from object1.just and object2.just by
white space.
If the justification qualifiers are omitted, a line will be drawn between the centers of the two objects
(clipped at the edges of the rectangles which define the objects). This is the same as using the .box
qualifier on both objects.
The curve option is explained with the aline command. Fig. 3.3 shows an example where the “join”
command is used with the curve option.
Sec. 7.1.1 contains several examples of joining objects.
local var1 , . . ., varn
Defines a local variable inside a subroutine. It is possible to initialize the variable to a particular
value with, e.g., ‘local x = 3’, which defines the local variable ‘x’ and assigns it the value 3. You
can also define several local variables at once, e.g., ‘local x, y’ defines the local variables ‘x’ and
‘y’.
margins top bottom left right
This command can be used to define the page margins. Margins are only relevant for making
full-page figures (using the -fullpage command line option). See also the “papersize” command.
marker marker-name [scale-factor]
Draws marker marker-name at the current point. The size of the marker is proportional to the
current font size, scaled by the value of scale-factor if present. Markers are referred to by name, eg.
square, diamond, triangle and fcircle. Markers beginning with the letter f are usually filled variants.
Markers beginning with w are filled with white so lines are not visible through the marker. For a
complete list of markers refer to Fig. 3.1.
set just lc
amove 0.5 2.5
marker diamond 1
rmove 0.6 0; text Diamond
amove 0.5 2
marker triangle 1
rmove 0.6 0; text Triangle
...
orientation o
Sets the orientation of the output in full-page mode. Possible values are “portrait” and “landscape”.
Fig. 3.2 illustrates these two cases.
papersize size
papersize width height
Sets the paper size of the output. This is used only when GLE is run with the option “-fullpage” or
when the PostScript output device is used (i.e., “-d ps”). The command either takes one argument,
16 CHAPTER 3. PRIMITIVES
29.7 cm
29.7 cm
29.7 cm
29.7 cm
10 cm
10 cm
10 cm 10 cm
21 cm 21 cm 21 cm 21 cm
Figure 3.2: Result of different combinations of the commands “papersize”, “margins”, “size”, and “ori-
entation” for fullpage graphics (gle -fullpage figure.gle).
GLE a
b
test.gle c
join b1.rc -> b2.tc curve 0 90 1.2 1 join a.c -> b.c
b
a
join b1.rc -> b2.h join a.c -> b.box
which should be one of the predefined paper size names or two numbers, which give the width
and height of the output measured in cm. The following paper sizes are known by GLE: a0paper,
a1paper, a2paper, a3paper, a4paper, and letterpaper.
If a “size” command is given in the script, then the output is drawn centered on the page. If no size
command is included in the script, then the output will appear relative to the bottom-left corner of
the page, offset by the page margins (see “margins” command). Fig. 3.2 illustrates these two cases.
The paper size can also be set in GLE’s configuration file (Sec. 7.5).
postscript filename.eps width-exp height-exp
Includes an encapsulated postscript file into a GLE picture, the postscript picture will be scaled up
or down to fit the width given. On the screen you will just see a rectangle.
Only the width-exp is used to scale the picture so that the aspect ratio is maintained. The height
is only used to display a rectangle of the right size on the screen.
print string$ . . .
This command prints its argument to the console (terminal).
psbbtweak
Changes the default behavior of the bounding box. The default behavior is to have the lower corner
at (-1,-1), which for some interpreters (i.e., Photoshop) will leave a black line around the bottom
and left borders. If this command is specified then the origin of the bounding box will be set to
(0,0).
This command must appear before the first size command in the GLE file.
pscomment exp
Allows inclusion of exp as a comment in the preamble of the postscript file. Multiple pscomment
commands are allowed.
3.2. GRAPHICS PRIMITIVES (IN DETAIL) 17
This command must appear before the first size command in the GLE file.
rbezier x1 y1 x2 y2 x3 y3
This command is identical to the BEZIER command except that the points are all relative to the
current point.
return exp
The return command is used inside subroutines to return a value.
reverse
Reverses the direction of the current path. This is used when filling multiple paths in order that
the Non-Zero Winding Rule will know which part of the path is ‘inside’.
With the Non-Zero Winding Rule an imaginary line is drawn through the object. Every time a
line of the object crosses it from left to right, one is added to the counter; every time a line of the
object crosses it from right to left, one is subtracted from the counter. Everywhere the counter is
non-zero is considered to be the ‘inside’ of the drawing and is filled.
0 1 0 1 0 0 1 2 1 0
rmove x y
Changes the current point to the relative coordinate (x,y). If the current point is (5,5) then rmove
3 -2 is equivalent to amove 8 3.
save objectname
This command saves a point for later use with the join command.
set alabeldist d
The spacing between the graph axis labels and the axis is set to d.
set alabelscale s
The graph axis label font size is set to ‘alabelscale’ times ‘hei’.
More complex examples of user-defined arrow styles can be found in the GLE example repository.
set atitledist s
The spacing between the graph axis title and the axis labels is set to d.
set atitlescale s
The graph axis title font size is set to ‘atitlescale’ times ‘hei’.
set background it c
Set the background color for a pattern fill to c. (See ‘set fill’.)
set cap butt — round — square
Defines what happens at the end of a wide line.
will draw a box and paint is using the shade pattern and red ink on a yellow background. To draw
shapes that are not filled, use the command “set fill clear”. That is,
amove 0.5 3
set just left Justify left Justify bl
box 1.5 0.6 tl tc tr
text Justify left
rmove 2 0 lc cc rc
set just bl
box 1.5 0.6
text Justify bl bl bc br
set titlescale s
The graph title font size is set to ‘titlescale’ times ‘hei’.
set ticksscale s
The size of the graph axis ticks is set to ‘ticksscale’ times ‘hei’.
sub tree x y a$
amove x y
rline 0 1
write a$
return x/y
end sub
text unquoted-text-string
This is the simplest command for drawing text. The current point is unmodified after the text is
drawn so following one text command with another will result in the second line of text being drawn
on top of the first. To generate multiple lines of text, use the begin text . . . end text construct.
write string$ . . .
This command is similar to text except that it expects a quoted string, string variable, or string
expression as a parameter. If write has more than one parameter, it will concatenate the values of
all the parameters.
The built in functions sqrt() and time$() are described in Appendix A.2.
22 CHAPTER 3. PRIMITIVES
Chapter 4
A graph should start with begin graph and end with end graph. The data to be plotted are organised into
datasets. A dataset consists of a series of (X,Y) coordinates, and has a name based on the letter “d” and
a number between 1 and 99, e.g. d1
The name dn can be used to define a default for all datasets. Many graph commands described below
start with dn. This would normally be replaced by a specific dataset number e.g.,
d3 marker diamond
For each xaxis command there is a corresponding yaxis, y2axis and x2axis command for setting the top left
and right hand axes. These commands are not explicitly mentioned in the following descriptions.
23
24 CHAPTER 4. THE GRAPH MODULE
vscale v
x2labels on
xaxis — yaxis — x2axis — y2axis
xaxis angle α
xaxis base exp-cm
xaxis color col font font-name hei exp-cm lwidth exp-cm
xaxis dsubticks sub-distance
xaxis format format-string
xaxis grid
xaxis log
xaxis min low max high
xaxis nofirst nolast
xaxis nticks number dticks distance dsubticks distance
xaxis ftick x0 dticks distance
xaxis off
xaxis shift cm-exp
xlabels font font-name hei char-hei color col
xnames ”name” ”name” ...
xnames from dx
xnoticks pos1 pos2 pos3 ...
xplaces pos1 pos2 pos3 ...
xside color col lwidth line-width off
xsubticks lstyle num lwidth exp length exp off
xticks lstyle num lwidth exp length exp off
xtitle ”title” [hei ch-hei] [color col] [font font] [dist cm] [adist cm]
y2title ”text-string” [rotate]
yaxis negate
bar dx,... dist spacing
bar dn,... fill f pattern p
bar dx,... from dy,...
bar dn,... horiz
bar dn,... width xunits,... fill col,... color col,...
fill x1,d3 color green xmin val xmax val
fill d4,x2 color blue ymin val ymax val
fill d3,d4 color green xmin val xmax val
fill d4 color green xmin val xmax val
colormap fct pixels-x pixels-y [color] [invert] [zmin z1 ] [zmax z2 ] [palette pal]
The colormap command is discussed in Section 8.5.
Weight
key pos br compact 40, 85, 77, 82
75
d1 line color red marker circle John
d2 line color blue marker triangle 70 Mary
d3 line color green marker square
end graph 65
Ken
15 20 25 30 35 40
Age
Figure 4.1: Line graph with key taken from the column labels in the first data row. Left: the graph
block; middle: the dataset “age.csv”; right: the resulting graph.
1, 2.7, 3
2, 5, *
3, 7.8, 7
4, 9, 4
The first point of dataset d1 would then be (1, 2.7) and the first point of dataset d2 would be (1,
3). The data values can be space, tab, comma, or semi-colon separated.
Missing values can be indicated with “*”, “?”, “-”, or “.”.
The option d3=c2,c3 allows particular columns of data to be read into a dataset. In this example,
d3 would read its x-values from column 2 and y-values from column 3.
Mon, 1
Tue, 4
Wed, 3.5
Thu, 2
Fri, 1
Sat, 5
Sun, 4
26 CHAPTER 4. THE GRAPH MODULE
then GLE creates an x-axis with one label for each day of the week, similar to that of the graph in
Fig. 4.11.
d3 err .1
d3 err 10%
d3 errup 10% errdown d2
d3 err d1 errwidth .2
Error Bars
begin graph 30
title "Error Bars"
dn lstyle 2 msize 1.5 20
d1 marker circle errup 30% errdown 1
d2 marker square err 30% errwidth .1 10
end graph
0
0 1 2 3 4 5 6 7 8 9 10
‘d1 line impulses’ ‘d1 line steps’ ‘d1 line fsteps’ ‘d1 line hist’
100 100 100 100
80 80 80 80
60 60 60 60
40 40 40 40
20 20 20 20
0 0 0 0
0 5 10 15 20 0 5 10 15 20 0 5 10 15 20 0 5 10 15 20
Figure 4.2: The impulses, steps, fsteps, and hist options of the line command.
ytitle "Output" 6
data "tut.dat" 4
d1 lstyle 2 2
d2 nomiss lstyle 1 marker diamond msize .2
end graph 0
1 2 3 4 5
Time
dn [smooth] [smoothm] line
This will make GLE draw a smoothed line through the points. A third degree polynomial is fitted
piecewise to the given points.
The smoothm alternative will work for multi valued functions, i.e., functions which have more than
one y value for each x value.
28 CHAPTER 4. THE GRAPH MODULE
x$ = "test.dat,2,3"
d1 file x$ line color red
fullsize
This is equivalent to scale 1 1, noborder. It makes the graph size command specify the size and
position of the axes instead of the size of the outside border. See Fig. 4.8 (right) for an example.
hscale h
Sets the length of the xaxis to h times the size of the graph box (default is 0.7). h can also be set
to ‘auto’. See scale for more details.
let ds = exp [from low] [to high] [step exp] [where exp]
This command defines a new dataset as the result of an expression on the variable x over a range
of values. For example:
The let command also allows the use of other datasets. E.g., to generate an average of two datasets:
data "file.csv" d1 d2
let d3 = (d1+d2)/2
4.2. GRAPH COMMANDS (IN DETAIL) 29
More precisely, this command creates a dataset with as x-values the union of the x-values from d1
and d2, and as y-values the average of the y-values of d1 and d2. That is, the let command first
computes the set of x-values by taking the union of the sets of x-values of all datasets that appear in
the expression together with the x-values generated by the from/to/step construct. Then it iterates
over these x-values. In each iteration, it assigns the x-value to the variable ‘x’, and, for each dataset
included in the expression, it assigns its corresponding y-value to the dataset identifier. Then it
evaluates the given expression exp and adds the resulting point (x,exp) to the target dataset. If the
let expression includes more than one dataset, and the x-ranges of these datasets are different, then
linear interpolation is used to compute the missing y-values.
If the xaxis is a ‘log’ axis then the ‘step’ option is read as the number of steps to produce rather
than the size of each step. The “from”, “to”, and “step” parameters are optional. The values of
“from” and “to” default to the horizontal axis’ range.
This command can also be used to modify the values in a data set, e.g., ‘let d1 = 2*d1’, will multiply
all y-values in dataset d1 by 2.
The option ‘where exp’ can be used to select values from a dataset, e.g., ‘let d1 = d2 where ((x >
10) and (x < 20))’ will select all points from d2 for which the x-value is between 10 and 20; ‘let d1
= d2 where d2 < 10’ will select all points for which the y-value is below 10.
let ds = x-exp, y-exp [from low] [to high] [step exp] [where exp]
This syntax for the ‘let’ command is similar to the previous one, but now two expressions can be
given: x-exp is used to compute the x-values of the points in the target dataset ‘ds’ and y-exp is
used to compute the y-values. The parameter that is modified by the from/to/step construct is
still the variable ‘x’.
This syntax can be used to perform transformations on both the x and the y-values of the points
in a dataset. For example,
y = ax + b
ytitle "$y = ax + b$"
data "data.csv" 6
let d2 = linfit d1 from 0 to 10 slope offset rsquare 4
d1 marker circle color blue y = 0.76x + 2.04
2
d2 line color red r2 = 0.73
end graph 0
0 2 4 6 8 10
begin key x
pos br nobox
text "$y = "+format$(slope,"fix 2")+"x + "+format$(offset,"fix 2")+"$"
text "$r^2 = "+format$(rsquare,"fix 2")+"$"
end key
• limit data x The range of the data in dn extends from the minimum x value in dm to the
maximum x value in dm.
• limit data y The range of the data in dn extends from the x value of the minimum y value
in dm to the x value of the maximum y value in dm.
• limit data The range of the data in dn extends from the greater of the x value of the minimum
y value or the minimum x value in dm to the greater of the x value of the maximum y value
or the maximum x value in dm.
begin graph
...
data "normal.csv"
let d2 = hist d1 step 0.5
d2 line bar color red
end graph
let ds = . . . [nsteps n]
The ‘nsteps’ options is an alternative to the ‘step’ option of the ‘let’ command. It specifies the total
number of steps rather than the step width. The default value for ‘nsteps’ is 100.
4.2. GRAPH COMMANDS (IN DETAIL) 31
a = 0; b = 0; c = 0; d = 0; r = 0
set texlabels 1
begin graph f (x) = a sin(bx) + cx2 + d
14
xtitle "$x$"
ytitle "$f(x)$" 12
title "$f(x) = a\sin(bx)+cx^2+d$" 10
data "data.csv" 8
let d2 = fit d1 with a*sin(b*x)+c*x^2+d rsq r
f (x)
6
d1 marker circle color blue
4
d2 line color red
end graph 2
0
f (x) = 2.81 sin(0.64x) + 0.14x2 + 1.12
fct$ = "$f(x) = "+format$(a,"fix 2")+ & -2 r2 = 0.844
"\sin("+format$(b,"fix 2")+"x)+"+ & -4
format$(c,"fix 2")+"x^2+"+ & 0 1 2 3 4 5 6 7 8 9 10
format$(d,"fix 2")+"$" x
begin key
pos br nobox
text fct$
text "$r^2$ = "+format$(r,"fix 3")
end key
1000 samples of N (µ = 0, σ = 1)
100
80
Frequency
60
40
20
0
-4 -3 -2 -1 0 1 2 3 4
Value
nobox
This removes the outer border from the graph.
size x y
Defines the size of the graph in cm. This is the size of the outside box of a graph. The default size
of the axes of the graph will be 70% of this, (see scale). If no size command is given, then the size
of the graph is initialized to the size of the figure (pagewidth() by pageheight()).
32 CHAPTER 4. THE GRAPH MODULE
Figure 4.7: Left: math mode graph. Right: graph illustrating the ‘origin’ option of ‘xaxis’.
Figure 4.8: Different axis scaling options: default, automatic, and ‘fullsize’. The blue dot indicates the
origin (x, y) of the graph, that is, the graph is generated with ‘amove x y’ followed by ‘begin graph’ ...
‘end graph’. The xaxis is labeled using the option ‘format pi’.
scale h v
Sets the length of the xaxis to h times the width of the graph box, and the length of the yaxis to
v times the height of the graph box. For example, with ‘size 10 10’ and ‘scale 0.7 0.7’, the length
of the x and y axis will be 7 centimeter. ‘scale 1 1’ makes the xaxis (yaxis) the same length as the
width (height) of the graph box, which is useful for positioning some graphs (see ‘fullscale’). The
default value for h and v is 0.7.
If h or v is set to the keyword auto, then the graph is scaled automatically in that direction to fill
the entire box. The command ‘scale auto’ automatically scales the graph in both directions. Note
that autoscale also moves the graph, similar to the command ‘center’.
This size command is equivalent to the two commands ‘hscale h’ and ‘vscale v’ and allows one to
specify the two scale factors with one command.
Fig. 4.8 shows examples of the different axis scaling options: default, automatic, and ‘fullsize’.
title ”title” [hei ch-hei] [color col] [font font] [dist cm]
This command gives the graph a centered title. The list of optional keywords specifies features of
it. The dist command is used for moving the title up or down. The default title font size is the
value of the ‘hei’ setting multiplied by the setting ‘titlescale’ (default 1.16).
vscale v
Sets the length of the yaxis to v times the size of the graph box (default is 0.7). v can also be set
to ‘auto’. See scale for more details.
under call
Executes subroutine ‘call’ before drawing the graph. The output is clipped to the graph window
and the subroutine can use the functions ‘xg()’, ’yg()’, and variables ‘xgmin’, ‘ygmin’, etc. This is
useful for drawing a custom graph background. It is also possible to include subroutine calls in the
graph block without the ‘under’ keyword. In that case, they are executed after the graph is drawn
and can be used to draw on top of the graph.
x2labels on
This command ‘activates’ the numbering of the x2axis. There is a corresponding command ‘y2axis
on’ which will activate y2axis numbering.
4.2. GRAPH COMMANDS (IN DETAIL) 33
Y2-axis
Y-axis
ytitle "Y-axis" 6
x2title "X2-axis" 4
y2title "Y2-axis"
x2ticks length 0.6 2
x2subticks color red 0
end graph 0 1 2 3 4 5 6 7 8 9 10
X-axis
xaxis angle α
Rotate the labels by α degrees. Fig. 4.12 gives an example.
xaxis grid
This command makes the xaxis ticks long enough to reach the x2axis and the yaxis ticks long
enough to reach the y2axis. When used with both the x and y axes this produces a grid over the
graph. Use the xticks lstyle command to create a faint grid.
xaxis log
Draws the axis in logarithmic style, and scales the data logarithmically to match (on the x2axis or
y2axis it does not affect the data, only the way the ticks and labeling are drawn)
Be aware that a straight line should become curved when drawn on a log graph. This will only
happen if you have enough points or have used the smooth option.
ylabels log off ylabels log l1 ylabels log l25 ylabels log l25b
3 3
10 10 10 100
9
8 5
7 50
6 2
2 5 2
10 10 20
4
5
3 10
2
10
1
10
1 5
2
5
2
2
0 0
10 1 10 1
0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5
main tick with main ticks 3 units apart, simply specify dsubticks 1.5. Alternatively, one can also
use nsubticks.
By default ticks are drawn on the inside of the graph. To draw them on the outside use the
command:
xaxis off
Turns the whole axis off — labels, ticks, subticks and line. Often the x2axis and y2axis are not
required, they could be turned off with the following commands:
x2axis off
y2axis off
xlabels [font font-name] [hei char-hei] [color col] [dist dis] [on] [off] [log lgmode]
This command controls the appearance of the axis labels. The default label font size is the value of
the ‘hei’ setting multiplied by the setting ‘alabelscale’ (default 0.8). The default value for dist
is controlled by the setting ‘alabeldist’.
The command ‘xlabels off’ turns the labels for the xaxis off. Similarly, ‘xlabels on’ turns them
on (the default for the x and y axis, but not for the x2 and y2 axis).
Possible values for lgmode are: ‘off’, ‘l1’, ‘l25’, and ‘l25b’. These control the subticks for a log
scale axis. The value ‘off’ means no subticks (i.e., only main ticks at 10k ), ‘l1’ means 10 subticks,
and ‘l25’ means two subticks at the positions 2 · 10k and 5 · 10k . The value ‘l25b’ is identical to
‘l25’ except that now the format function (given with the ‘format’ option of the ‘xaxis’ command)
is used to label the subticks. In the other case, the subticks are labeled with the values ‘2’ and ‘5’
in a small font (0.7 times the size of the main tick labels). These settings are illustrated in Fig. 4.9.
2 2
1 2 5 10 2 5 10 1 10 10
add ‘xlabels log off’ add ‘xsubticks off’ add ‘xsubticks on’ add ‘xlabels log l25’
2 2 2 2
1 10 10 1 10 10 1 10 10 1 2 5 10 2 5 10
also turns off sublabels also turns on subticks
Happyness
title "Names \& Places"
xnames "Mon" "Tue" "Wed" "Thu" 12
xnames "Fri" "Sat" "Sun" 8
xaxis min 0 max 6 dticks 1
... 4
end graph 0
Mon Tue Wed Thu Fri Sat Sun
would give the desired result (Fig. 4.11). Note it is essential to define a specific axis minimum,
maximum, dticks, etc., otherwise the labels may not correspond to the data.
If there isn’t enough room on the line for all the names then simply use an extra xnames command.
xnames from dx
Takes the labels for the xaxis from dataset dx. For example, if the data file contains:
0, Mercury, 0.382
1, Venus, 0.949
2, Mars, 0.532
3, Jupiter, 11.21
4, Saturn, 9.449
5, Uranus, 4.007
6, Neptune, 3.883
then ‘ynames from d1’ uses the data from the second column as labels for the yaxis (Fig. 4.12).
xplaces 1 2 5 7
xnames "Mon" "Tue" "Fri" "Sun"
If there isn’t enough room on the line for all the places then simply use an extra xplaces command.
xtitle ”title” [hei ch-hei] [color col] [font font] [dist cm] [adist cm]
This command gives the axis a centered title. The list of optional keywords specify features of
it. The dist option is used for controlling the distance between the title and the axis labels. The
default font size is the value of the ‘hei’ setting multiplied by the setting ‘atitlescale’ (default
1.0). The default value for dist is controlled by the setting ‘atitledist’. The ‘adist’ option is an
alternative to ‘dist’, but specifies the distance between the title and axis itself. This option is useful
for perfectly aligning, e.g., the y-axis titles of multiple graphs (if the graphs are in one vertical
column, but their y-axis labels have a different width).
xaxis negate
This is reversed the numbering on the y axis. For use with measurements below ground, where you
want zero at the top and positive numbers below the zero.
y2title ”text-string” [rotate]
By default the y2title is written vertically upwards. The optional rotate keyword changes this
direction to downwards. The rotate option is specific to the y2title command.
begin graph
xaxis min 0 max 9 nofirst nolast
xaxis hei 0.4 nticks 6 dsubticks 0.3
xaxis lwidth 0.05 color red 4
10 10
xticks length 0.2
Y2title rotated
ytitle "Log Yaxis" 10
3
Log Yaxis
5
yaxis log min 1 max 10
yticks length 0.2 2
10
y2axis min 1 max 10000 format "sci 0 10"
2 1
y2side color blue 10
y2title "Y2title rotated " hei 0.3 rotate
0
x2axis off 1 10
1.5 3.0 4.5 6.0 7.5
y2labels on
let d1 = sin(x)*4+5 from 0 to 9
dn line color blue
end graph
For grouped bars put all the datasets in a list on a single bar command:
bar d1,d2,d3 fill gray10,gray40,black
Planet sizes
ne
ptu
Ne us
an
Ur n
tur
Sa r
e
pit
Ju
rs
Ma
u s
n
Ve y
r
rcu
Me
0 1 2 3 4 5 6 7 8 9 10 11 12
Size relative to Earth
Figure 4.12: Illustration of the ‘horiz’ and ‘pattern’ keywords of the ‘bar’ command, and of the ‘angle’
option of the ‘yaxis’ command.
bar d1,d2
bar d3,d4 from d1,d2
bar d5,d6 from d3,d4
Note 1: It is important that the values in d3 and d4 are greater than the values in d1 and d2.
Note 2: Data files for stacked bar graphs should not have missing values, replace the * character
with the number on its left in the data file.
Bean stalk data
5
Height of stalk
begin graph 4
...
3
data "gc_bean.dat"
bar d1 fill gray20 2
bar d2 from d1 fill white 1
end graph
0
85 86 87 88 89 90 91
Year measured
bar d1,d2 width 0.2 dist 0.2 fill gray10,gray20 color red,green
bar dx,... 3d xoffset yoffset side color list top color list [notop]
3d xoffset yoffset
Specifies the x and y vector used to draw the receding lines, they are defined as fractions of the
width of the bar. A negative xoffset will draw the 3d bar on the left side of the bar instead of the
right hand side.
notop
Turns off the top part of the bar, use this if you have a stacked bar graph so you only need sides
on the lower parts of each stack.
5.0
...
data "gc_bean.dat" 4.0
bar d1,d2,d3 dist 0.25 width 0.15 3d 1 0.25 & 3.0
fill red,blue,forestgreen & 2.0
side orange,dodgerblue,green 1.0
end graph 0.0
86 87 88 89 90
Year measured
begin graph
size 10 10
data a.dat
let d2 = d1*3
dn marker square lstyle 3 ! sets d1 and d2
d2 marker dot
xaxis color green
xticks color blue
x2axis color black
end graph
size 10 10
set lwidth .1
begin graph
...
end graph
40 CHAPTER 4. THE GRAPH MODULE
Chapter 5
The key module is used for drawing keys. The key can be either specified through a separate key block or
directly in the graph block (by prefixing the key commands with the keyword “key”). This chapter first
discusses how to define the key using a key block. Section 5.3 shows how to include the key commands
directly in a graph block.
The key block usually comes directly after the graph block as follows:
begin graph
...
end graph
begin key
position tr
offset 0.2 0.2
text "Blue" marker circle fill blue
text "Red" marker triangle fill red lstyle 2
text "Orange" marker square fill orange lstyle 3
end key
10.0
Blue
7.5 Red
Green
5.0
2.5
0.0
0.0 2.5 5.0 7.5 10.0
The key block consists of two parts: (a) global commands, and (b) the definitions of the entries. Global
commands appear at the beginning of the key and define, e.g., the position of the key. In the example,
“position” and “offset” are global commands. Multiple global commands are allowed on a given line. The
entry definitions start after the global commands. All commands relevant to a given entry must appear
on the same line. In the example, there are three entry definitions and each definition starts with the
“text” command. Entries can be organized into columns using the “separator” command.
There are two possible ways to set the position of a key: (a) the key can be positioned relative to the
graph, and (b) it can be positioned at given coordinates. To position the key relative to the graph, use
the commands “position” and (optionally) “offset”. For example,
position tr
offset 0.2 0.2
41
42 CHAPTER 5. THE KEY MODULE
justify bc
absolute pagewidth()/2 0.1
places the key at the top-right corner of the graph 0.2 cm from each side. To position the key at given
coordinates use the “justify” and “absolute” commands. For example,
justify bc
absolute 5 0.1
places the bottom-center of the key at position (5 cm, 0.1 cm). Fig. 5.1 gives some examples of positioning
the key.
justify x
Sets the anchor point of the key. Possible values: tl, bl, tr, br, tc, bc, lc, rc, cc. These stand for
top-left, bottom-left, top-right, bottom-right, top-center, bottom-center, left-center, right-center,
and center. Use this command in combination with the “absolute” command. Fig. 5.1 gives some
examples.
llen x
Sets the length of the line in the entries.
lpos x
Sets the vertical position of the line in the entries. (This is normally set automatically.)
margins x y
Sets the margins of the key block. (The space between the border and the entries.)
nobox
Do not draw a border around the key.
off
Disable this key.
offset x y
Specifies the distance in cm between the position specified with the “position” or “pos” command
and the actual key. A negative offset places the key outside of the graph (Fig. 5.1).
position x or pos x
Specifies the position of the key on the graph. Possible values: tl, bl, tr, br, tc, bc, lc, rc, cc. These
stand for top-left, bottom-left, top-right, bottom-right, top-center, bottom-center, left-center, right-
center, and center. Optionally, the “offset” command can be combined with this command. Fig. 5.1
gives some examples.
color c
Sets the color of the line and marker. The other components of the key are drawn in the default
color. (To set the default color, use “set color”, see page 18.)
fill p
Sets the fill color or pattern.
line
Shorthand for “lstyle 1”.
lstyle s
Sets the line style.
lwidth
Sets the width of the line.
marker m
Sets the marker.
mscale x
Sets the scale of the marker.
msize x
Sets the size of the marker.
pattern x
Sets the filling pattern. Fig. 3.6 shows examples of filling patterns.
44 CHAPTER 5. THE KEY MODULE
Red Orange
Green Purple
Blue Black
0.5
0.0
-0.5
Sine
Cosine
-1.0
0 /2 3 /2 2
Figure 5.3: Defining the key together with the graph block.
separator [lstyle s]
Use this command to divide the key into multiple columns. If the “lstyle” option is given, then a
line is drawn between the columns in the given style. Possible values are given with the description
of the “set lstyle” command on page 20. The “separator” command should be inserted between the
key entries that should go in different columns. For example,
begin key
position bl
line color red text "Red"
line color green text "Green"
line color blue text "Blue"
separator
line color orange text "Orange"
line color purple text "Purple"
line color black text "Black"
end key
text s
The text for the entry.
begin graph
title "Implicitly defined key"
let d1 = sin(x)
let d2 = cos(x)
xaxis min 0 max 2*pi dticks pi/2 format "pi"
key compact pos bl
d1 line color red marker triangle mdist 1 key "Sine"
5.3. DEFINING THE KEY IN THE GRAPH BLOCK 45
Programming Facilities
6.1 Expressions
Wherever GLE is expecting a number it can be replaced with an expression. For example
rline 3 2
and
then nargs() returns 2, arg$(1) returns “Title”, and arg(2) returns 0.5.
The typical use of these functions is to create a script “graph.gle” as follows:
size 10 10
begin graph
title arg$(1)
data arg$(2)
d1 line color red
end graph
47
48 CHAPTER 6. PROGRAMMING FACILITIES
eng 3 append g
0.00 g 500 g 1.00 kg 1.50 kg 2.00 kg
eng 3 10 num
-6 -6 -3 0 0 3 6
1.00 10 100 10 10.0 10 1.00 10 100 10 10.0 10 1.00 10
eng 3 append
1.00 100 10.0 m 1.00 100 10.0 k 1.00 M
pi
0 /2 3 /2 2
frac
-1 -3/4 -1/2 -1/4 0 1/4 1/2 3/4 1
fix 2
-1.00 -0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00
This will create two graphs: “beans.eps” and “peas.eps”. The arg() functions can be used at all
places in the script where an expression is expected. They can even be used in place of GLE
commands in a graph block by means of the \expr() function. For example,
data "file.csv"
d\expr{arg(1)} line color red
in the graph block will allow one to draw different datasets from a single file on multiple graphs.
To do so, run:
This subroutine together with other subroutines for computing the minimum, mean, area, etc. of
a dataset are defined in the include file ‘graphutil.gle’, which is distributed together with GLE.
format$(exp,format)
Returns a string representation of exp formatted as specified in format.
Basic formats:
• append s: appends the string s after the formatted number. This can be used to add a unit.
6.2. FUNCTIONS INSIDE EXPRESSIONS 49
text abc
set color blue
text def
50 CHAPTER 6. PROGRAMMING FACILITIES
This would draw the def on top of the abc. To draw the def immediately following the abc simply
do the following (Note that absolute move is used, not relative move):
xpos(), ypos()
Returns the current x and y points.
See Appendix A.2 for an overview of all functions provided by GLE.
this would be laborious to type in, and would become impossible to manage with several grids. By using
a simple loop this can be avoided:
for x = 0 to 6
amove x 0
rline x 8
next x
for y = 0 to 8
amove 0 y
rline 6 y
next y
6.5. IF-THEN-ELSE 51
Besides for-next loops, GLE also supports while and until loops:
i = 0
while i <= 10
print "Value: " i
i = i + 1
next
i = 0
until i > 10
print "Value: " i
i = i + 1
next
6.5 If-then-else
GLE supports if-then-else statements as follows:
to create blocks of code for the ‘then’ and ‘else’ branches, instead use:
if a < 1 then
print a "is smaller than 1"
...
else
...
end if
More complex conditions can be created with the logic connectives ‘and’, ‘or’, and ‘not’ (note the paren-
thesis around the logical expressions):
if (a >= 1) and (a <= 10) then print "a is between 1 and 10"
6.6 Subroutines
To draw lots of grids all of different dimensions a subroutine can be defined and then used again and
again:
sub grid nx ny
local x, y
begin origin
for x = 0 to nx
amove x 0
aline x ny
next x
for y = 0 to ny
amove 0 y
aline nx y
next y
end origin
end sub
amove 2 4
grid 6 8
amove 2 2
grid 9 5
52 CHAPTER 6. PROGRAMMING FACILITIES
Inside a subroutine, the keyword ‘local’ can be used to define local variables. E.g., ‘local x = 3’,
defines the local variable ‘x’ and assigns it the value 3. It is also possible to define several local variables
at once, as is shown in the ‘grid’ example above.
The keyword ‘return’ can be used to return a value from a subroutine. E.g.,
The main GLE file will be much easier to manage if subroutine definitions are moved into a separate file:
include "griddef.gle"
amove 2 4
grid 2 4
amove 2 2
grid 9 5
More information about the “include” command can be found on page 14.
mysub 1 0
mysub 1 0 red
mysub 1 0 red green
mysub 1 0 fill blue
mysub 1 0 color red
mysub 1 0 color red fill blue
fwrite file x1 . . .
Write given arguments to “file”.
fwriteln file x1 . . .
Write given arguments to “file” and start a new line.
For example:
if pos(device$(),"PS,",1)>0 then
set font psncsb
end if
54 CHAPTER 6. PROGRAMMING FACILITIES
Chapter 7
Advanced Features
7.1 Diagrams
7.1.1 Named Boxes and the Join Command
GLE can name objects using the “begin/end name” (p. 10), “begin/end box” (p. 9), and “begin/end
object” (p. 10) constructs, and using the “name” option supported by some drawing commands. The
name is always associated with the rectangular region on the figure that corresponds to the bounding
box of the object (the smallest rectangle that surrounds all points of the object). The following example
shows how to create a blue rectangle named “square” and a box with the text “Title” named “titlebox”.
amove 1 1
box 1 1 fill blue name square
amove 5 5
begin box add 0.1 name titlebox
write "Title"
end box
The “join” command (p. 14) can now be used to draw lines or curves (optinally with arrows) between
designated points of the named objects. The following example shows how to draw an arrow from
the top-right (“.tr”) point of the blue square to the bottom-centre point (“.bc”) of the object named
“titlebox”.
The “->” in the join command indicates that the arrow should go from the first object towards the
second. The symbol “<-” is used to draw the arrow in the opposite direction. A bidirectional arrow is
obtained with “<->” and a line without an arrow is obtained with “-”. The join command can also create
Bezier curves instead of straight lines. See the command’s description on p. 14 for more information.
The named points (corners, centre points, ...) on each named object are indicated as defined in Table 7.1.
“.box” clipping is the default and can be omitted.
It is also possible to name an individual point (instead of an object). To do so, simply move there and
save that point as a named object.
55
56 CHAPTER 7. ADVANCED FEATURES
The functions “pointx” (abbreviated to “ptx”, see p. 49), “pointy” (abbreviated to “pty”), “width”, and
“height” (p. 49) apply to named points and objects. They retrieve the “x” respectively “y” coordinate
of a named point, and the width and height of a named object. For example:
print ptx(square.tr)
print pty(square.tr)
print width(square)
print height(square)
Complete Example
Below is a complete example that makes use of the constructs described above. The resulting figure is
shown in Fig. 7.1.
amove 3 16
begin box name grv add 0.3 round 0.3 fill lightcyan
write "GRV"
end box
amove 3 10
begin box name goats add 0.3 fill lightcyan
write "Goats"
7.1. DIAGRAMS 57
Cheese
GRV
CHV
Goats
Main
Hi there
end box
amove 13 1.5
begin box name hi add 0.3 fill lightcyan
write "Hi there"
end box
set just rc
amove pointx(house.lc)-0.5 pointy(house.window.cc)
begin name windowlabel add 0.05
write "house.window.cc"
end name
house.window.cc
house.door.cc
set texlabels 1
begin graph √
x− 5
... Plot of f (x) = (x−1)·(x−4)
6
title "Plot of $f(x) =
\frac{x-\sqrt{5}}{(x-1)\cdot(x-4)}$" 4 √
xtitle "$x$" 5
2
y = f (x)
ytitle "$y = f(x)$"
... 0
end graph
-2
set just bc -4
amove xg(sqrt(5)) yg(2.5)
tex "$\sqrt{5}$" add 0.1 name sq5b -6
0 1 2 3 4 5
x
amove xg(sqrt(5)) yg(0); save sq50
join sq5b.bc -> sq50
LATEX expressions are drawn on top of all other graphics and cannot clipped (Sec. 7.3).
LATEX expressions respect the ‘just’ setting and, depending on the value of ‘texscale’, also the ‘hei’
setting (the font size). If ‘set texscale scale’ is used, then LATEX expressions are scaled to the value
of ‘hei’. If ‘set texscale none’ is used, then LATEX expressions are not scaled. As a result, the font
sizes in your graphics will be exactly the same as in your main document. To obtain different font sizes,
use the font size primitives provided by LATEX (e.g., \large, . . .). Finally, if ‘set texscale fixed’ is
used, then the default LATEX size that most closely matches the value of ‘hei’ is selected.
begin texpreamble
\documentclass{llncs}
\usepackage{amsmath}
\usepackage{amssymb}
\DeclareMathSymbol{\R}{\mathbin}{AMSb}{"52}
end texpreamble
\documentclass{article}
\usepackage{graphics}
\begin{document}
\begin{figure}
\includegraphics{sin}
\caption{\label{sin}The sine function.}
\end{figure}
\end{document}
An alternative method is by using GLE’s command line option ‘-inc’. If this option is supplied, then
GLE will create besides the usual .eps or .pdf file also an .inc file. This .inc file can be imported in a
LATEX document as follows.
\input{myfile.inc}
The .inc file tells latex (or pdflatex) to include the .eps/.pdf output file created by GLE. It also
includes TEX draw commands for drawing the LATEX expressions on top of the GLE output. Note that
the .eps/.pdf file created by GLE does not include these if -inc is used (you can check this by viewing
it with GhostView).
To be able to include .inc files, the following must be included in the preamble of your LATEX document.
\usepackage{graphics}
\usepackage{color}
If you place your .gle files in a subdirectory of the directory where your LATEX document resides, the .inc
file created by GLE should include the path to this subdirectory in the ‘\includegraphics’ primitive
it uses for including the .eps/.pdf file generated by GLE. To add this path, use the ‘-texincprefix’
command line option of GLE. For example, if your GLE files are in a subdirectory called ‘plots’ then one
should run GLE as follows.
GLE can color and rotate LATEX expressions (use ‘set color’ and ‘begin rotate’). Note however that
‘xdvi’ does not support these effects, so you will not be able to see them if you use this viewer. In the
final PostScript or PDF output, they will of course be displayed correctly.
The main advantage of using the -inc method is that the resulting file size will be smaller because the
LATEX fonts are not included in the .eps/.pdf file generated by GLE.
size 10 5
begin clip ! Save current clipping path
begin path clip stroke ! Define new clipping region
amove 2 2
box 3 3
amove 6 2
box 3 3
end path
amove 2 2
set hei 3
text Here is clipped text
end clip ! Restore original clipping path
Here is
7.4 Colour
Internally GLE treats color and fill identically, they are simply an intensity of red, green and blue. Each
of the predefined color names (yellow, grey20, orange, red) simply define the ratio of red, green and blue.
A sample of the predefined color names is included in Appendix A.7.
There are two ways to use variables to show color, one is for shades of grey:
for i = 0 to 10
box 3 .2 fill (i/10)
rmove 0 .2
next i
sub stick c$
box .2 2 fill c$
end sub
stick "green"
A color can also be defined based on its RGB values with the rgb255 primitive.
mycolor$ = "rgb255(38,38,134)"
Remember a fill pattern completely obscures what is behind it, so the following command would produce
a box with a shadow:
amove 4 4
box 3 2 fill grey10
rmove -.1 .1
box 3 2 fill white
rmove .4 .4
text hellow
62 CHAPTER 7. ADVANCED FEATURES
The supported paper sizes are listed with the description of the “papersize” command on page 15.
The configuration file can also be used to override default locations of external tools such as GhostScript
and LaTeX.
Note that GLE expands environment variables in the tool locations. If I’m john, then GLE will search
for GhostScript in /home/john/bin/gs in the above example. It is also possible to specify additional
command line options to be passed to the tools by means of ghostscript_options, pdflatex_options,
latex_options, and dvips_options. In the above example, the option “-j0” will be passed to dvips.
As a result, it will not subset fonts.
Chapter 8
63
64 CHAPTER 8. SURFACE AND CONTOUR PLOTS
300
begin surface 250
size 7 7 200
data "jack.z"
150
cube zlen 13
100
top color orange
50
underneath color red
0
end surface 0
5
10
18 20
15 14 16
20
8 10 12
25 6
30 2 4
Data files can be created using LETZ or FITZ. LETZ will create a data file from an x,y function.
FITZ will create a data file from a list of x,y,z data points.
xsample Tells surface to only read every n’th data point from
the data file. This speeds things up while you are
messing around.
(see also POINTS)
ysample Tells surface to only read every n’th line from the
data file.
sample Sets both xsample and ysample
size 5 5 1.6
xtitle "X-axis"
1.4
ytitle "Y-axis"
data "surf1.z" 1.2
end surface
1
1
2 4
X-a3 4 3
xis 2
5 Y-axis
harray n
The hidden line removal is accomplished with the help of an array of heights which record the
current horizon, the quality of the output is proportional to the width of this array. (also the speed
of output)
To get good quality you may want to increase this from the default of about 900 to 2 or 3 thousand.
e.g. harray 2000
xlines off
Stops SURF from drawing lines of constant X.
8.1. SURFACE PRIMITIVES 65
ylines off
Stops SURF from drawing lines of constant Y.
begin surface 3
size 5 5 2.5
data "surf1.z" 2
zaxis min -1 max 3 1.5
base xstep 0.5 ystep 0.5 1
back ystep 1 zstep 1 0.5
rotate θ φ x rotate 10 20 3
Imagine the unit cube is sitting on the front of your terminal screen, x along the bottom, y up the
left hand side, and z coming towards you.
The first number (10) rotates the cube along the xaxis, ie hold the right hand side of the cube and
rotate your hand clockwise 10 degrees.
The second number (20) rotates the cube along the yaxis, ie hold the top of the cube and rotate it
20 degrees clockwise.
The third number is currently ignored.
The default setting is 60 50 0.
view x y p
Sets the perspective, this is where the cube gets smaller as the lines dissappear towards infinity.
x and y are the position of infinity on your screen. p is the degree of perspective, 0 = no perspective
and with 1 the back edge of the box will be touching infinitiy. Good values are between 0 and 0.6
66 CHAPTER 8. SURFACE AND CONTOUR PLOTS
1
View point 0
begin surface
-1
size 5 5
2
data "surf1.z"
3
zaxis min -1
rotate 85 85 0
4
view 0 5 0.7
end surface
4
3
2
5
1
ytitle "Y-axis" 1
ztitle "Z-axis" 0.5
points "surf3.dat" 0
-0.5
riselines lstyle 2
-1
is 4
marker fcircle 1
2
3
skirt on 3
ax
2
X-a 4
Y-
rotate 60 35 0 xis 5
1
8.2 Letz
LETZ generates a data file of z values given an expression in terms of x and y.
begin letz
data "jack.z"
z = x+sin(y^2)/pi+10.22
x from 0 to 30 step 1
y from 0 to 20 step 1
end letz
The file jack.z now contains the required data. The resulting file can be used to generate surface plots
with the begin/end surface block discussed in the previous section.
8.3 Fitz
FITZ fits smooth curves based on a set of 3D data points. E.g., given some data points (note that each
line has three values: an x, y, and z coordinate):
x y z
---- data file testf.dat -----
1 1 1
1 2 1
2 2 1
2 1 1
1.5 1.5 2
------------------------------
Fitz creates a ”.z” file that can be used in a surface block, a colormap or contour plot. The following
example illustrates this.
begin fitz
data "fitz.dat"
x from 0 to 5 step 0.2
y from 0 to 5 step 0.2
2.5
ncontour 6
end fitz 2
8.4 Contour
The contour block produces contour lines of a function z = f (x, y).
The function f (x, y) is given by a .z file. The .z file format is discussed on page 64. Recall that a .z file
can be created from sample data points, that is (x, y, z) tuples, with the fitz block (Section 8.3), or from
an implicit definition of f (x, y) with a letz block (Section 8.2).
68 CHAPTER 8. SURFACE AND CONTOUR PLOTS
begin graph 10
0.5
title "Saddle Plot Contour Lines"
data "saddle-cdata.dat" 5
0.5
d1 line color blue
end graph
0 1.5 3.0 2.0 1.0
contour_labels "saddle-clabels.dat" "fix 1" 0 2 4 6 8 10
data file$
Specifies the name of the .z file.
values v1 , . . . , vn
Specifies the z-values to contour at.
smooth integer
Specifies the smoothing parameter.
The contour block creates the files “data-clabels.dat” and “data-cdata.dat” with the prefix “data” the
name of the .z file. The file “data-clabels.dat” contains information for drawing labels on the contour
plot. This is done by the subroutine contour labels defined in the library “contour.gle” in the example
above. The file “data-cdata.dat” contains the (x, y) values of the contour lines. This file can be used as
input to a graph block and plotted with the “d1 line” command as shown in the example above.
colormap fct pixels-x pixels-y [color] [invert] [zmin z1 ] [zmax z2 ] [palette pal]
• fct specifies the function to map. This can either be the name of a .z file, or it can be a function
definition f (x, y).
8.5. COLOR MAPS 69
• pixels-x, pixels-x specify the dimension of the color map. A color map is a stored as a bitmap
image and (pixels-x, pixels-x) are the resolution of this bitmap. A larger resolution yields more
detail, but at the cost of longer computation time and a larger file size.
• color is an optional argument and indicates that the color map should be drawn in color (as
opposed to grayscale).
• invert is an optional argument that inverts the color map. That is, large function values will
be drawn in black and small function values in white.
• zmin, zmax are optional arguments that specify the range of the function.
• palette is an optional argument that specifies the palette to use. A palette is a subroutine that
maps z values to colors. A number of example palette subroutines are included in the library
“color.gle”.
GLE Utilities
9.1 Fitls
The FITLS utility allows an equation with n unknown constants to be fitted to experimental data.
For example to fit a simple least squares regression line to a set of points you would give FITLS the
equation: a*x+b
FITLS would then solve the equation to find the best values for the constants a and b.
FITLS can work with non linear equations, it will ask for initial values for the parameters so that a
solution around those initial guesses will be found.
FITLS writes out a GLE file containing commands to draw the data points and the equation it has fitted
to them.
Here is a sample FITLS session:
$ fitls
Input data file (x and y columns optional) [test.dat,1,2] ? fitls.dat
Loading data from file, fitls.dat, xcolumn=1, ycolumn=2
Valid operators: +, -, *, /, ^ (power)
Valid functions:
abs(), atn(), cos(), exp(), fix(), int()
log(), log10(), not(), rnd(), sgn(), sin()
sqr(), sqrt(), tan()
Equation ? sin(a*x)*b+c*x^2+d
71
72 CHAPTER 9. GLE UTILITIES
2
y = sin(-0.638262*x)*-2.81719+0.140722*x +1.11256, fit = 0.938389
12
. .
11
10
9
8
. . . . .
7
6
5
4
3
2 . .
1 2 3 4 5 6 7 8 9
9.2 Manip
Manip is a data manipulation package. It reads in a text file of numbers and displays them like a
spreadsheet. You can then do simple operations on the columns and write them out in any format you
like.
9.2.1 Usage
MANIP infile.dat -recover -step -commands c.log -single -size x y
–recover
Manip logs everything you type to a file called MANIP_.J1 When you use the -RECOVER option on
the manip command it then reads keys from that file as if they were typed at the keyboard.
This will restore you to the point just before your pc crashed. The last three journal files are stored
(.j1 .j2 .j3) simply copy the one you want to (.j1) to use it.
–step
Used with recover, press a space for each key you want to read from the journal file, press any other
key to stop reading the journal.
–commands filename.man
This reads the commands in filename.man as if they were typed at the keyboard.
–single
This makes MANIP use single precision arithmetic and doesn’t store strings at all, this enables three
times as much data in the same amount of memory
–size x y
Sets the initial size of the spreadsheet. Use this with large datasets as it prevents the heap from
becoming fragmented and thus lets you use much larger datasets.
Range
Most manip commands accept a range as one or more of there parameters. A range is a rectangular
section of your spreadsheet. A range can ether start with a ’c’ or an ’r’ and this will affect how the
command operates.
If your spreadsheet has 5 columns and 10 rows then.
9.2. MANIP 73
Arrows
The arrow keys normally move the data cursor, however if you are half way thru typing a command then,
the left and right arrow keys allow you to edit the command. Use the PAGE-UP and PAGE-DOWN keys
to recall your last command.
SHIFT arrow keys will jump 7 cells at a time for fast movement.
Further help is available on the following toppics via the HELP command e.g. ”HELP COPY”
Numbers are shuffled in from the right to take the place of the deleted range.
DATA [range]
Data entry mode is usefull for entering data. After typing in "% DATA c1c3" or "% DATA C2" you
can then enter data and pressing ¡cr¿ will move you to the next valid data position. In this mode
text or numbers can be entered. Press ESC to get back to command mode.
FIT c3
"FIT C3" will fit a least squares regression line to the data in columns c3 and c4 (x values taken
from c3) and print out the results.
EXIT
EXIT saves the data in your input file spec and exits to DOS. You can optionally specify an output
file as well. eg. "% EXIT myfile.dat"
The command "EXIT myfile.dat c3c5r1r3" will write out that range of numbers to the file.
By default manip will write columns seperated by spaces.
The command "EXIT myfile.dat -TAB" will put a single tab between each column of numbers
and "EXIT myfile.dat -COMMA" will put a comma and a space between each number. (these two
options are usefull if your data file is very big and you don’t want to waste diskspace with the space
characters.) Note: The settings stay in effect for future saves and exits.
You can make it line up the columns on the decimal point by typing in the command.
"SET DPOINTS 3"
You change the width of each column or completely remove the spaces between columns with the
command. "SET WIDTH 10" (or set width 0)
You can change the number of significant digits displayed with the command "SET DIGITS 4"
SAVE myfile.dat
Saves all or part of your data. The command "SAVE myfile.dat c3c5r1r3" will write out that
range of numbers to the file.
By default manip will write columns seperated by spaces.
The command "SAVE myfile.dat -TAB" will put a single tab between each column of numbers
and "SAVE myfile.dat -COMMA" will put a comma and a space between each number. (these two
options are usefull if your data file is very big and you don’t want to waste diskspace with the space
characters).
Further options are the same like EXIT
GOTO
For moving the cursor directly to a point in your array. e.g. "% GOTO x y"
CLEAR
"% CLEAR C2C3" Clears the given range of all values
9.2. MANIP 75
BLANK
"% BLANK C2C3" Clears the given range of all values
NEW
Clears the spread sheet of all data and frees memory.
INSERT
Inserts a new column or row and shifts all others over. e.g."% INSERT c5" or "% INSERT r2".
LOAD
Load data into columns. eg. "% LOAD filename" loads all data into corresponding columns.
"% LOAD filename c3" load first column of data into c3 etc.
"LOAD myfile.dat c3 -LIST" This commmand will load the the data into a single column or
range (even if it is several columns wide in the data file)
This command works out how to sort the column (or exp) specified in the ON part of the command.
It then does that operation to the range specified. e.g. "SORT C1 ON C1" will sort column one.
Use the additional qualifier -STRINGS if you want to sort a column with strings in it. e.g.
"sort c1 on c2 -strings"
SWAP
Swap over two columns or rows. e.g.
SET BETWEEN ” ”
"SET BETWEEN "##" Defines the string to be printed between each column of numbers when written
to a file. This is normally set to a single space.
76 CHAPTER 9. GLE UTILITIES
SET COLWIDTH
Set the width of each column when displayed. e.g. "% SET COLWIDTH 12"
SET COLTYPE [n] DECIMAL — EXP — BOTH — DPOINTS n
This commands allows all or individual columns to be set to different output types. If colnumber
is missing then that setting is applied to all columns.
SET COLTYPE Ccolnumber TYPE Where TYPE is one of:
SET WIDTH n
Sets the width of padding to use for the columns when they are written to a file. The columns
usually one space wider than this setting as the BETWEEN string is usually set to one space by
default.
LOGGING
For creating command files. e.g.
Functions
Calculations can be performed on rows or columns. eg "% C1=C2*3+R" where ”R” stands for row-
number and C1 and C2 are columns. They can also be performed on ROWS. eg
r1=sin(r2)+log10(c)
c1 = cell(c+1,r)+cell(c+2,r)
cell(1,3) = 33.3
3+4*COS(PI/180)^(3+1/30)+C1+R
, + − ^ ∗ / <=
>= <> < > = )AND( )OR(
ABS( ATN( COS( EXP( FIX( INT( LOG(
LOG10( SGN( SIN( SQR( TAN( NOT( RND(
SQRT( .NE. .EQ. .LT. .GT. .LE. .GE.
.NOT. .AND. .OR.
QUIT
Abandon file.
SHELL
Gives access to DOS.
78 CHAPTER 9. GLE UTILITIES
Appendix A
Tables
A.1 Markers
triangle fcircle odot ❀ flower ✍ handpen
wtriangle diamond ominus ♣ club ✉ letter
ftriangle wdiamond oplus heart ☎ phone
square fdiamond otimes ♠ spade ✈ plane
wsquare cross star dag ❍ scircle
fsquare plus ✥ star2 ddag ❏ ssquare
circle
wcircle
minus
asterisk
✯ star3
❂ star4 . snake
dot
trianglez
diamondz
79
80 APPENDIX A. TABLES
csch(exp) 1/sinh(exp)
dataxvalue(ds,i) x-value of i-th point in ds (p. 48)
datayvalue(ds,i) y-value of i-th point in ds (p. 48)
date$() current date e.g. “Tue Apr 09 1991”
device$() available devices e.g. “HARDCOPY, PS”
eval(str) evaluates given GLE expression
exp(exp) exponent
\expr(exp) substitute result of evaluating “exp”
file$() returns GLE file name (without extension)
fix(exp) exp rounded towards 0
format$(exp,format) format exp as specified in format (p. 48)
height(name$) the height of the object name$
int(exp) integer part of exp
left$(str$,exp) left exp characters of str$
len(str$) the length of str$
log(exp) log to base e of exp
log10(exp) log to base 10 of exp
nargs() number of command line arguments
ndata(ds) number of points in data set ds (p. 48)
not(exp) logical not of exp
num1$(exp) as above but with no spaces
num$(exp) string representation of exp
pageheight() the height of the page (from size command)
pagewidth() the width of the page (from size command)
path$() returns the directory where the script is located
pointx(pt) the x value of named point pt
pointy(pt) the y value of named point pt
pos(str1$,str2$,exp) position of str2$ in str1$ from exp
ptx(pt) the x value of named point pt (abbreviation for pointx)
pty(pt) the y value of named point pt (abbreviation for pointy)
rgb(red,green,blue) create color given RGB values
rgb255(red,green,blue) create color given RGB values
right$(str$,exp) rest of str$ starting at exp
rnd(exp) random number between 0 and exp
sdiv(x,y) return x/y or 0 if y = 0
sec(exp) 1/cos(exp)
sech(exp) 1/cosh(exp)
seg$(str$,exp1,exp2) str$ from exp1 to exp2
sgn(exp) returns 1 if exp is positive, -1 if exp is negative
sin(exp) sine of exp
sinh(exp) hyperbolic sine
sqr(exp) exp squared
sqrt(exp) square root of exp
tan(exp) tangent of exp
tanh(exp) hyperbolic tangent
tdepth(str$) the depth of str$ assuming current the font, size
theight(str$) the height of str$ assuming current font, size
time$() current time e.g. “11:44:27”
todeg(exp) convert from radians to degrees
torad(exp) convert from degrees to radians
twidth(str$) the width of str$ assuming current font, size
val(str$) value of the string str$
A.2. FUNCTIONS AND VARIABLES 81
TEXComputer Modern Sans Serif (texcmss) TEXComputer Modern Sans Serif Bold (texcmssb)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 0
2 2
4 4
6 6
8 8
10 10
12 12
14 14
16 16
18 18
20 20
22 22
24 24
TEXComputer Modern Sans Serif Italic (texcmssi) TEXComputer Modern Typewriter Text (texcmtt)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 0
2 2
4 4
6 6
8 8
10 10
12 12
14 14
16 16
18 18
20 20
22 22
24 24
TEXComputer Modern Italic Typewriter (texcmitt) TEXComputer Modern Maths Italic (texcmmi)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 0
2 2
4 4
6 6
8 8
10 10
12 12
14 14
16 16
18 18
20 20
22 22
24 24
A.6. FONT TABLES 87
wall.gle
Index
!, 8, 25 color, 37
\expr(exp), 80 dist, 37
.z file, 67 fill, 37
?, 25 from, 37
@, 8 width, 37
LATEX, 11, 82 bar graphs, 36
macros, 82 bar graphs 3d, 38
LATEX expression, 58 base, 66
3d bar baselineskip, 11
notop, 38 begin
offset, 38 box, 9
side, 38 clip, 10
top, 38 name, 10
object, 10
abound, 8 origin, 10
abs(), 79 path, 10
acos(), 79 rotate, 10
acosh(), 79 scale, 10
acot(), 79 table, 10
acoth(), 79 text, 11
acsc(), 79 text (single line), 21
acsch(), 79 translate, 11
add, 9 bevel, 20
alabeldist, 17, 34 bezier, 12
alabelscale, 17, 34 bezier (rbezier), 17
aline, 9 Bezier curve, 9
aline (closepath), 12 bitmap, 12
amove, 9 bitmap info, 12
amove (origin), 10 BLANK, 75
angle, 10 border, 31
arc, 9 box, 12
arcto, 9
arg(), 47, 79 cap, 18
arg$(), 47 center, 24
arrow, 9, 17 char, 11
arrowangle, 17 character size, 20
arrowsize, 17 chardef, 11
arrowstyle, 18 circle, 12
asec(), 79 clear, 74
asech(), 79 clip, 10, 60
asin(), 79 clipping, 60
asinh(), 79 closepath, 12
atan(), 79 color, 18
atanh(), 79 color (graph lines), 26
atitledist, 18, 36 color (title), 32
atitlescale, 18, 36 color (variables), 61
atn(), 79 color-variables, 61
colormap, 68
back, 66 command, 12
bar graph block, 24
97
98 INDEX
ellipse, 13 harray, 64
elliptical arc, 13 hei, 20
elliptical narc, 13 height(), 49, 80
INDEX 99
histogram, 30 let, 28
horiz, 37 hist, 30
horizontal error bars, 26 nsteps, 30
hscale, 28 range, 31
let (order), 39
I/O-functions, 52 line, 26
if, 14, 51 line width (graphs), 39
ignore, 25 lineskip, 11
include, 14, 52 linfit, 29
insert, 75 load, 75
int(), 80 local, 15, 52
log, 33
join, 14, 20 log(), 80
join (set join), 20 log10(), 80
joining, 55 log10fit, 29
just, 20 logfit, 29
justify (box), 12 logging, 76
justify (join), 14 loops, 50
justify (set), 20 lstyle, 20
justify (text), 11 lstyle (graph lines), 26
lstyle (set), 20
key, 26 lwidth, 20
data based, 25 lwidth (graph lines), 26
hei, 28 lwidth (graphs), 39
nobox, 28
offset, 28 Manip, 72
pos, 28 Arrows, 73
key (module), 41 Range, 72
key module usage, 72
absolute, 42 marker, 15, 27, 66
boxcolor, 42 markers, 79
coldist, 42 mathchar, 11
color, 43 mathchardef, 11
compact, 42 mathcode, 11
dist, 42 missing, 26
fill, 43 missing value, 25
hei, 42 mitre, 20
justify, 43 move, 75
line, 43 movexy, 11
llen, 43
lpos, 43 name (box), 9, 12
lstyle, 43 name (join), 14
lwidth, 43 name (point), 17
margins, 43 narc, 9
marker, 43 nargs(), 47, 80
mscale, 43 ndata, 48, 80
msize, 43 negate, 36
nobox, 43 new, 75
off, 43 next, 13, 50
offset, 43 noborder, 31
pattern, 43 nobox, 9, 12, 31
position, 43 nofirst, 33
row, 42 nolast, 33
separator, 44 nomiss, 27
text, 44 not(), 80
nsteps, 30
LaTeX packages, 59 nsubticks, 33
left$(), 80 nticks, 33
len(), 80 num1$(), 80
100 INDEX
under, 32 xplaces, 35
underneath, 66 xpos(), 50, 81
Unicode, 59 xside, 35
until, 51 color, 35
UTF-8, 59 lwidth, 35
xsubticks, 35
val(), 80 length, 35
values, 68 lstyle, 35
variables, 47, 50 lwidth, 35
view, 65 off, 35
vscale, 32 xticks, 36
length, 36
while, 51 lstyle, 36
width(), 49, 81 lwidth, 36
wmarker, 15 off, 36
write, 21 xtitle, 36, 65
adist, 36
x2axis (see xaxis), 33 color, 36
x2labels dist, 36
on, 32 font, 36
x2side (see xside), 35 hei, 36
xaxis, 33, 65 xy2angle(), 81
base, 33
color, 33 y2axis (see xaxis), 33
dsubticks, 33 y2side (see xside), 35
dticks, 33 y2title rotate, 36
font, 33 yaxis, 65
grid, 33 yaxis (see xaxis), 33
hei, 33 yend(), 49, 81
log, 33 yg(), 50, 81
lwidth, 33 yg2max, 81
max, 33 yg2min, 81
min, 33 ygmax, 81
neagte, 36 ygmin, 81
nofirst, 33 ylines, 65
nolast, 33 ynames (see xnames), 34
nsubticks, 33 yoffset, 38
nticks, 33 ypos(), 50, 81
off, 34 yside (see xside), 35
shift, 34 yticks (see xticks), 36
xbar(), 81 ytitle, 65
xend(), 49, 81 ytitle (see xtitle), 36
xg(), 50, 81
xg2max, 81 zaxis, 65
xg2min, 81 zclip, 67
xgmax, 81 ztitle, 65
xgmin, 81
xlabels, 34
color, 34
dist, 34
font, 34
hei, 34
log, 34
off, 34
on, 34
xlines, 64
xnames, 34
xnoticks, 35
xoffset, 38