Defines the positions and appearance of the plotting windows within the frame of a high-resolution graph.
||Specifies grid lines (
||Whether to include a box enclosing the entire frame (
||Specifies the colour to be used for the background of the whole frame (where allowed by the graphics device)|
||Whether to reset the window definition to the default values (
||Lower y device coordinate for each window|
||Upper y device coordinate for each window|
||Lower x device coordinate for each window|
||Upper x device coordinate for each window|
||Size of bottom margin (for x-axis labels)|
||Size of upper margin (for overall title)|
||Size of left-hand margin (for y-axis labels)|
||Size of right-hand margin|
||Specifies the colour to be used for the background in each window (where allowed by the graphics device)|
||Whether to include a box enclosing the plotted graphic (
||Box to include in a surface plot (
||Box to draw around key (
||Pen to use to write the overall title|
||Pen to use for the key|
||Pen to use to draw the grid lines|
||How to scale the axis in each window (
||Position of title (
||Specifies the colour to be used for the interior of each window (where allowed by the graphics device)|
||Specifies the colour to be used for the frame of each window (where allowed by the graphics device)|
||Specifies the colour to be used for the title bar of each window (where allowed by the graphics device)|
||Additional oblique axes to include in each window|
||Saves details of the current settings for the window concerned|
You can define up to 256 different windows in which to plot graphics. Each window is a rectangular area of the screen which is defined using normalized device coordinates (NDC). These can have a range from 0.0 to 1.4 in both Y and X directions, but the usable area depends on the orientation of the device (as defined by the
DEVICE directive). With a landscape device, your should use only the range 0.0 to 1.0 for Y, while for a portrait device you should use only 0.0 to 1.0 in the X direction. The mapping from NDC to physical coordinates on the current output device is performed internally, so the window definitions are independent of the choice of device. The actual size of a particular window on different devices will vary according to their relative physical sizes. The NDC system used for window definition is also completely independent of the values of the data that are to be plotted.
When you use
FRAME, any aspects of the windows that you do not specify explicitly retain the values that they had immediately before the
FRAME statement. Alternatively, you can specify option
RESET=yes to reset all these aspects to the default values, defined by Genstat at the start of each job.
To define a window, the upper and lower bounds are required in both y- and x-directions; thus defining both the position and the size of the window. For example
FRAME WINDOW=1; YLOWER=0.25; YUPPER=0.75;\
defines window 1 to be a square of size 0.5, whose bottom left corner is at the point (0.0,0.25) and whose top right corner is (0.5,0.75). This does not define the exact size of a graph plotted in this window, as margins may be required for the annotation and titles (see below).
If you do not specify all four values in the
FRAME statement, the existing values are retained. A check is then made on the validity of the window bounds. The settings of
XLOWER must be strictly less than those of
XUPPER respectively; also, none of the bounds can be outside the permitted range, which is [0.0,1.0] on most graphics devices. You cannot use
* to reset a bound to the default value; if you try to do so, Genstat will produce an error diagnostic. (Instead you can specify option
RESET=yes, as explained above.)
All the windows have a default size defined when you start Genstat. Window 1 is the default window used for plots by
DCONTOUR, and so on, and is set up to be a square of size 0.75. The default key window is window 2, which is a rectangle of height 0.25 and width 0.75 located immediately below window 1. Windows 3 and 4 are the unit square [0,1]×[0,1] and windows 5, 6, 7 and 8 are the top-left, top-right, bottom-left, and bottom-right quarters respectively of the unit square. Windows 9, 10, 11 and 12 also divide the frame into quarters, but they have the full width (0 to 1) in the x-direction and quarter of the width in the y-direction, working from the top (i.e. 0.75 to 1 for window 9) to the bottom (i.e. 0 to 0.25 for window 12) of the frame. The remaining windows, from 13 to 32, also default to the unit square. You can use
FRAME to modify the size or position of any of these windows.
Usually, a margin is provided around each plot so that there is room for the axes to be drawn, along with labelling and titles as specified by the
YAXIS directives. By default, the margin size is designed to allow sufficient room for annotation to be added using the standard character size, as defined by the
SMLABEL parameters of
PEN. If you use
YAXIS to control the plotting of axes explicitly you may wish to alter the size of the margins, either to increase the space used for the axes or, alternatively, to maximize the space available for the graph itself. For example, if you alter the size of the labelling, by explicitly defining the relevant axis pens, more space may be required for the axes; otherwise the labels may be clipped at the window bounds. The parameters
XMUPPER can be used to set the space (in NDC) for the bottom, top, left-hand and right-hand margins respectively, and have initial default settings of 0.10, 0.07, 0.12 and 0.05.
On most devices the background colours of the window may be modified by setting the
CTITLE parameters. The
BACKGROUND parameter can be used to define the colour for the whole background, while the other parameters define specific aspects (overriding any setting of
CINTERIOR defines the colour of the interior of the plot (where the points are plotted),
CFRAME defines the colour of the outer frame (outside the interior), and
CTITLE is the colour of the title bar. The parameters can be set either to a text containing the name of one of Genstat’s pre-defined colours, or to a scalar containing a number defining a colour using the RGB system; see the
PEN directive and the
RGB function for details. Similarly, the
BACKGROUND option can define the background colour for the whole frame (which may include areas outside any of the windows). The special colour setting
'match' can be used to apply the colour from the preceding parameter to the next one:
CFRAME would inherit the colour from
CINTERIOR , and
CTITLE would inherit from from
CFRAME . For example,
FRAME 1; CINTERIOR='white'; CFRAME='ivory'; CTITLE='match'
will specify colour white for the inside of the plot, and ivory to all the area outside this.
PENKEY options allow you to define the pens to be used to write the overall title and the key in each window; the initial default is to use pen -5 and -6 respectively. The
TPOSITION parameter can be used to specify the position of the title in each window: either left-justified, right-justified or centred. The initial default is that it is centred.
GRID option allows you to request grid lines to be drawn in particular directions and planes (for all the windows listed by the
WINDOW parameter). For example the setting
xy requests lines in the xy plane running from the x-axis (that is, parallel to the y-axis), and the setting
yx requests lines in the xy plane running from the y-axis (that is, parallel to the x-axis); so you can set both of these to obtain box markings in the xy plane. The
PENGRID parameter specifies the pen to be used for the grid lines in each window; the initial default is to use pen -4. You must use the
RESET option if you want to restore these pen numbers to the initial defaults. (Genstat does not allow you to set negative pen numbers explicitly.) The
BOX parameter allows you to put a box around the window in plots other than surface plots; the initial default is to include this. The box for a surface plot is controlled by the
BOXSURFACE option, and can either be a full box enclosing the whole graph, or a bounded box enclosing just the surface; the initial default is that no box is drawn. The
BOXKEY parameter can request that either a full or a bounded box be drawn around each key; the initial default is to omit the box. Finally, the
BOXFRAME option controls whether or not a box is drawn around the entire frame; the initial default is to omit the box.
SCALING parameter enables you to request that scaling of the x-, y- or z-axes should be equal in each window. For example, the
xyequal setting ensures that the x- and y-axes are scaled identically, the setting
xyzequal ensures that all the axes have the same scaling, and so on.
AXES parameter allows you to specify the identifier of an oblique axis (defined by the
AXIS directive) that should be included in a window. If you want to include several axes, you can specify a pointer containing the identifiers of the required axes.
FRAME settings for a particular window can be saved in a pointer supplied by the
SAVE parameter. The elements of the pointer are labelled to identify the components.
Commands for: Graphics.
" Example FRAM-1: Drawing pictures in separate graphical windows Demonstrates four graphical entities - graph, contour, pie and histogram - within a single picture " " Define the position of four windows in [0,1] coordinates" FRAME 1; YLOWER=0.0; YUPPER=0.4; XLOWER=0.4; XUPPER=0.8 FRAME 2; YLOWER=0.4; YUPPER=0.8; XLOWER=0.0; XUPPER=0.4 FRAME 3; YLOWER=0.4; YUPPER=0.8; XLOWER=0.4; XUPPER=0.8 FRAME 4; YLOWER=0.0; YUPPER=0.4; XLOWER=0.0; XUPPER=0.4 " Draw some annotated lines with DGRAPH in window 1" AXES 1; YLOWER=0; YUPPER=10; XLOWER=0; XUPPER=8 VARIATE Y[1...7]; !(1,2,3,7,9), !(1,2,3,5,8), !(1,2,3,5,7),\ !(1,2,3,5,6), !(1,2,6,5.5,5), !(1,2,7,5,4), !(1,2,8,4,3) VARIATE X; !(1...5) SCALAR [VALUE=7] N VARIATE [NVALUES=N] XX,YY TEXT [VALUES='G','E','N','S','T','A','T'] TXT CALC NUM = NVAL(Y) CALC XX$[1...N] = X$[NUM]+0.5 CALC YY$[1...N] = Y[1...N]$[NUM] PEN 2; LINESTYLE=1; METHOD=monotonic; SYMBOL=0 PEN 3; SYMBOL=0; LABEL=TXT; METHOD=point DGRAPH [TITLE='Graph';WINDOW=1;KEYWINDOW=0] Y,YY; (X)7,XX; PEN=(2)7,3 " Draw a contour plot in window 2" MATRIX [ROW=16; COLUMNS=18] M OPEN '%gendir%/examples/DCON-1.DAT'; CHANNEL=data1; WIDTH=200 READ [CHANNEL=data1] M CLOSE data1 DCONTOUR [TITLE='Contour'; WINDOW=2; KEYWINDOW=0; SCREEN=keep] M " Draw a pie chart in window 3" VARIATE [VALUES=1,1.1,1.2,1.3] Amount PEN 1...4; BRUSH=12,13,9,8 " DPIE requires a series of numbers rathger than a variate, so substitute the contents of the variate with the # symbol. By default, DPIE will use pens 1...4 for the 4 sectors of the pie chart" DPIE [TITLE='Pie Chart'; WINDOW=3; KEYWINDOW=0; SCREEN=keep] #Amount " Draw a histogram in window 4" FILEREAD [NAME='%gendir%/examples/DHIS-1.DAT'] X1,X2,X3,X4,X5 VARIATE FRED; !(1,2,4,8,16) TEXT NAME; !T(A,BB,CCC,DDDD) PEN 1...5; BRUSH=1,12,3,7,11 " By default, DHISTOGRAM will use pen 1 for the first variate, pen 2 for the second, and so on." DHISTOGRAM [WINDOW=4; KEYWINDOW=0; SCREEN=keep; TITLE='Histogram';\ LABELS=NAME] X1,X2,X3,X4,X5