Next Previous Contents

1. Introduction

This document is intended to introduce the skills needed to produce technical diagrams and graphs using the graphics package GLE. The bulk of the text is a series of tutorials which illustrate many of the important commands and concepts. Readers who are already familiar with GLE 3.3 or 3.5 may wish to skip the tutorial section and use only the reference section in the appendix.

1.1 What is GLE?

GLE, or Graphics Language Editor, is a programming language whose command set is dedicated almost entirely to graphical output. Using this language it is possible to produce accurately drawn graphs and diagrams, with a high degree of control over the finished output. Like all other programming languages, it is necessary to learn some basic commands before very much can be achieved, and in this respect, GLE differs from more traditional methods of producing graphics. It lacks the immediate feedback of a point and click type interface, nor is it as easily understood.

The strength of GLE lies in its reproducibly and in its adaptability. Rather than a set of pixel values, a GLE diagram is stored as a series of vector drawing instructions. A line is stored as a line, a circle as a circle. The GLE package itself takes these instructions and converts them into a recognisable graphic. Many of the concepts from other programming languages can also be included in the code. Variables, subroutines, and programming loops can all greatly simplify the diagrams we wish to produce by allowing us to refer back to and reuse drawing instructions. We are also given a great deal of control over the finished output. There are very few complex commands in GLE; much of what we draw must be built up from a series of lines and other shapes. Although this can take a lot of time, the simplicity of the interface means that we are always in control of exactly what appears on screen.

GLE is a program written with scientists in mind; its command set is well suited to producing graphics for inclusion in reports and papers. These graphics are often difficult or impossible to produce in a graphics package. Scientists may require a large number of slightly different elements, or an exactly drawn mathematical shape. They may simply require line widths and font heights to be changed easily and repeatedly, (e.g. at the whim of a publisher!) If you either do not need, or can already produce, graphics that satisfy these requirements then it is probably not worth taking the time to learn GLE. If you need technical diagrams, and lack the artistic ability or tolerance to produce them by hand, then GLE can make their production great deal more painless.

1.2 What do I need to use GLE?

Through necessity this document must start from a basic level of computer and scientific literacy. A fair degree of experience using computers is assumed throughout; as is an acquaintance of programming concepts such as reusable code and subroutines. Obtaining the GLE program itself is covered in a following section, however some form of text editor with which to prepare the programming scripts is also required. Emacs or Pico in Linux, Edit in MS-Dos, or Notepad in Windows, are all perfectly suitable.

Many of the programming examples are mathematical in nature, and require the use of simple, and occasionally not so simple, expressions. These are on the whole self explanatory, at least at undergraduate level and above. Where possible some explanation has been offered or, failing that, a reference to a more detailed description has been given. As much of GLE is based on the Cartesian coordinate system, a good grasp of trigonometry is essential. Converting between this and polar coordinates, or even simply calculating the components of a vector are skills routinely used in most GLE scripts.

The examples included are meant to be representative of those found in text books or papers. A word of warning however, their purpose is to illustrate the use of commands, not to teach any meaningful science. The data used was not checked for accuracy, and in some cases entirely made up. Equally, to make the diagrams as simple and illistrative as possible some physical correctness may have been lost.

1.3 Where are we going?

Due to the public nature of the GLE code we shall beginning with some, unfortunately necessary, technical notes on the different versions available. Following this we shall examine a series of worked examples falling into the following sections:

Simple applications

As an introduction we look at diagrams that can be drawn using the simplest possible building blocks. These can be accomplished both within the GLE program, and with a traditional graphics package. The examples will illustrate the different approaches taken in each case.

Formal development

The programming aspect of the language is developed allowing us to produce much more complex routines. This shows many of the advantages, and some of the disadvantages, GLE has over its alternatives.

The graph module

A major part of GLE is its ability to take raw data and produce a graph with a high degree of control over the finished appearance. This section is largely self-contained and relies only a little on the previous sections.

More complex examples

A look at some of the more complex graphics that can be produced, using some of the less common commands.

We shall conclude with a reference section that explains the commands used in GLE, and contains most of the available formatting options.


Next Previous Contents