Getting better graphs from Genstat

Using graphical environments

The default graphs produced by Genstat have thin lines, small fonts, and symbols made by lines which are unfilled. These plots are the fastest and lightest on resources but do not have much “presence” on the screen. It possible to change all these options in the menu before generating the graph or later interactively in the graphics viewer. The menus all have options tabs to allow these to be set up, but they reset each time the menu windows are closed. By double clicking a plot in the Graphics Viewer you get into the graphics edit mode, where you can change particular attributes, like a font size or fill a symbol on a particular graph, but unless you have only a few graphs or only want to change one feature of a graph, this can become very time consuming.

Graphics environment menu windowThe solution to the problems is to use a Graphics environment.

A menu for these can be opened by selecting Tools | Graphics environments on the menu bar. The resulting dialog is shown on the right.

The ‘Genstat Default Environment’ at the top is the default environment with single thickness lines and unfilled symbols.

However, the standard Genstat release provides five other environments.


The ‘Grayscale graphics’ environment sets all colour to black, grey or white, suitable for a journal publishing in black and white, ‘Bold symbols and lines’ increases the font sizes, fills the symbols and uses thicker lines to improve the presence of your graphics, the two ‘Microsoft Excel style graphics’ use the colours and styles of the graphics provided by the earlier and current editions of Excel, and the ‘R style graphics’ uses the colours and styles of the statistical package R.

Choosing one of these options will change the defaults for all subsequent graphics. You can quickly change between styles, by opening this menu and selecting a new environment.

The figure below shows how some of these environments differ from the default.



Alternatively, you can create your own customized or personal environments by starting with any one of the standard environments, modifying it, and then saving it with a new name. This will then be added to the list of graphics environments.

For example, if you wanted a bolder set of graphs but wanted to reduce the font size from that of the ‘Bold symbols and lines’ environment, you would click on the New button, and get the menu on the right. Select the environment you want to use as a starting point, give the environment a description, and click Create. This will open the menu, two of whose tabs are shown below. This allows you to modify a number of attributes for the graph interactively, including the Grid, Key, Outlines, Axes, Frame and Symbols with their font sizes.

Not all graphics attributes can be modified with the Graphics Environments Attributes dialog but, with some programming all the settable attributes can be modified (see the end of the article). When you click OK on the dialog above, the graphics environment is created.


The new environment, with the description that you have defined, will now be available in the list of environments. The file MyGraphics1.ggd, that was the default filename in the Create New Graphics Environment dialog, can now be found in ‘My Documents\GenStatAddIns\graphics’. If you give this file to another user to put into their directory of that name, they will then be able to create graphs with the same settings as you. This can be very helpful if you work as part of a team. To make a change to a particular environment without creating a new environment, you would click on this environment, and click the Edit button in the Graphics Environment dialog.

Afterwards, if you look in the Input log (as below), you will see that a script of graphics commands has been sent to the server to set the options for frames, pens and symbols to have the values defined in graphics environment.


You may have noticed the PENS -1…-10 in the Input log. These are special pens that set the defaults for the pens for the axis title pen, axes, axes labels, grid, title, key, DSHADE grid, histogram outlines, barchart outlines, pie outlines. Further, PEN -11 sets the pen attributes for drawing error bars. The last command in the Input Log window is a DSAVE command, to save the environment.


If you are familiar with the graphics commands, you might want to cut and paste the commands from the input log into a Edit window, modify some of the settings in the FRAME, AXIS and PEN commands, and then rerun the commands to create an new version of MyGraphics1.ggd. This allows you to modify aspects that are not covered in the Graphics Environments Attributes dialog. You can also obtain the commands used to create the standard graphics environments, by opening the example for the DLOAD command, which is used to load them. This can be done using the Example Programs menu, obtained by selecting Help | Examples | Commands on the menu bar. Details of the graphics commands are in the on-line help, or in Chapter 6 of the Guide to Syntax and Data Management.