Plots a bit map of RGB colours.
Options
TITLE = text |
General title; default * |
---|---|
WINDOW = scalar |
Window number for the graph; default 1 |
YORIENTATION = string token |
Y-axis orientation of the plot (reverse , normal ); default reve |
GRIDMETHOD = string token |
How to draw a grid around the elements of the matrix (present , complete ); default * i.e. none |
PENGRID = scalar |
Pen to use for the grid; default -7 |
SCREEN = string token |
Whether to clear the screen before plotting or to continue plotting on the old screen (clear , keep ); default clea |
ENDACTION = string token |
Action to be taken after completing the plot (continue , pause ); default * uses the setting from the last DEVICE statement |
Parameters
BITMAP = symmetric matrix, matrix, table, pointer to variates or variate |
Data to be plotted |
---|---|
ROWS = variate |
Row indexes for a BITMAP variate |
COLUMNS = variate |
Column indexes for a BITMAP variate |
Description
DBITMAP
plots a 2-dimensional bit map of RGB colours. These use a standard way of representing a colour, as a single number whose bits are partitioned into three ranges to record the three component colours of red, blue and green (see the PEN
directive for more details). They can be read in to Genstat from devices such as scanners, or calculated using the RGB
function.
The data are specified by the BITMAP
parameter. Data values in a regular two-way grid can be specified by supplying their RGB colours in either a matrix, a symmetric matrix, a 2-way table or a pointer to a set of variates. Alternatively, you can specify irregular data by setting BITMAP
to a variate of colours, and the ROWS
and COLUMNS
parameters to variates defining their row and column indexes.
The GRIDMETHOD
option allows you to draw an outline around each element of the plot. The present
setting produces an outline for all values that are present; i.e. it ignores missing values. This is suitable where data have been sampled over an irregularly shaped area. Alternatively, with the complete
setting, an outline is drawn around every element. By default, no grid is drawn. The PENGRID
option specifies which pen to use to draw the grid. The default is to use pen -7.
The YORIENTATION
option controls the orientation of the y-axis. By default this is reversed, so that the data are in the same order as they would take if the data matrix were printed.
The TITLE
, WINDOW
, SCREEN
and ENDACTION
options are used to specify a title, the plotting window, whether the screen should be cleared first, and whether there should be a pause once the plotting is finished; as in other graphics directives (see, for example, DGRAPH
).
Options: TITLE
, WINDOW
, YORIENTATION
, GRIDMETHOD
, PENGRID
, SCREEN
, ENDACTION
.
Parameters: BITMAP
, ROWS
, COLUMNS
.
Action with RESTRICT
DBITMAP
takes account of restrictions on any of the variates in a BITMAP
pointer.
See also
Directives: DCONTOUR
, DSHADE
, DSURFACE
, D3HISTOGRAM
, FRAME
, XAXIS
, YAXIS
, PEN
, MATRIX
, POINTER
, SYMMETRICMATRIX
, TABLE
.
Functions: BLUE
, GREEN
, GRAY
, GREY
, RED
, RGB
.
Commands for: Graphics.
Example
" Example 1:6.5.1 " " Get location of image file for use by IMPORT " SCALAR _chan OPEN '%GENDIR%/Examples/GuidePart1/CapeWagtail.jpg'; _chan; FILE=input ENQUIRE CHANNEL=_chan; FILE=in; NAME=file CLOSE _chan; FILE=input IMPORT [PRINT=*; RGBMETHOD=matrix] file; COLUMNS='RGB' " resize the window to match the dimensions of the bit map " CALCULATE Nr = NROWS(RGB) & Nc = NCOLUMNS(RGB) IF Nr < Nc FRAME 3; YUPPER=Nr/Nc ELSE FRAME 3; XUPPER=Nc/Nr ENDIF DBITMAP [WINDOW=3] RGB