1. Home
  2. DVIEW directive

DVIEW directive

Options

PAUSE = scalar Time in seconds to pause before changing to the next window; default 1

Parameter

WINDOW = scalar  Window number to view

Description

The Genstat Graphics Viewer displays all graphs sent to DEVICE 1 in windows, only one of which can be seen at a time. The open windows are always numbered sequentially from one. You can use DVIEW to display any of these windows. The WINDOW parameter specifies which one to display. A positive integer n displays the nth window. Alternatively, a negative integer –n displays the nth window from the top: for example WINDOW=-2 displays the graph plotted immediately before the most recent graph. If a list of windows is provided, the windows are displayed sequentially. The PAUSE option specifies how long to wait, in seconds, before moving on to the next window; default 1. This allows you to create an animated series of graphs. For example DVIEW [PAUSE=0.5] 1...100 creates a movie from the first 100 graphs in the viewer, displaying each new frame after a half second delay. The minimum pause achievable between graphs will depend on the complexity of the graphs and the speed of the computer. Options: PAUSE. Parameter: WINDOW.

See also

Directive: DCLOSE.
Commands for: Graphics.

Example

" Movie with DVIEW "
DCLOSE    " Close viewer."
SCALAR    N; VALUE=100
VARIATE   [VALUES=1...N] Index
CALCULATE t = Index + 4
&         X = (t)**(2/3)*COS(C('pi')*(t/3)**(2/3))
&         Y = (t)**(2/3)*SIN(C('pi')*(t/3)**(2/3))
PEN       1,2; SYMBOL='circle'; COLOUR='black','red'; CFILL='match'; SIZE=0.5,2
FOR       [NTIMES=N; INDEX=i]
  CALC    Pen = 1 + (Index == i)
  DGRAPH  [WINDOW=3; KEY=0] Y; X; PEN=Pen
ENDFOR
%SLEEP 10 " Allow graphs to display in viewer."

DVIEW     [PAUSE=0.1] 1...N
DCLOSE 0  " Close all windows."
Updated on February 2, 2023

Was this article helpful?