1. Home
  2. DARROW procedure

DARROW procedure

Adds arrows to an existing plot (D. B. Baird).

Options

WINDOW = scalar Window number for the graphs; default 3
COORDINATETYPE = string token Type of coordinate to use for the locations of the arrows (frame, graph); default grap
YUPPER = scalar Maximum vertical coordinate in the frame; default 1
XUPPER = scalar Maximum horizontal coordinate in the frame; default 1
ISTYLE = string token The type of symbol at the start of the arrow (none, open, closed, circle); default none
ESTYLE = string token The type of symbol at the end of the arrow (none, open, closed, circle); default open
ISIZE = scalar The size of the symbol at the start of the arrow; default 1
ESIZE = scalar The size of the symbol at the end of the arrow; default 1
IANGLE = scalar The angle in degrees of the starting arrowhead when ISTYLE is open or closed; default 45
EANGLE = scalar The angle in degrees of the ending arrowhead when ESTYLE is open or closed; default 45
LAYER = scalar The plot layer for the arrows; default is a new layer above the previous plot items

Parameters

IY = variates, scalars or factors The starting y-positions of the arrows
IX = variates, scalars or factors The starting x-positions of the arrows
EY = variates, scalars or factors The ending y-position of the arrows
EX = variates, scalars or factors The ending x-position of the arrows
COLOUR = variates, scalars, texts or factors Colour of the arrows; default 'black'
LINESTYLE = variates, scalars or factors Linestyle of the line in the arrows; default 1
THICKNESS = variates, scalars or factors Thickness of the line in the arrows; default 1
TRANSPARENCY = variates, scalars or factors Transparency of the arrows; default 0

Description

DARROW adds arrows or lines to existing plots. The coordinates defining the start and end points of the arrows are specified by the IY, IX, EY and EX parameters. The COLOUR, LINESTYLE, THICKNESS and TRANSPARENCY parameters specify the colour, linestyle, thickness and transparency (0 = opaque – 255 = completely transparent) of each arrow. These can supply a single value, if all the arrows are to have the same attribute; otherwise, they should supply a structure of the same length as the IY vector.

The WINDOW option specifies the number of the window containing the existing plot. By default, the points defining the arrows are specified in terms of the x- and y-axes in the plot. However, you can set option COORDINATETYPE=frame to define the points relative to the frame. The maximum size of the frame is then defined by the XUPPER and YUPPER options.

The ISTYLE and ESTYLE options control the symbols at the start and end of the arrow, respectively. Similarly, the ISIZE and ESIZE options define the symbol sizes. The IANGLE and EANGLE options control the angle between the two sides at the start and end of the arrowheads. Setting the angles to values greater than 180 (e.g. 315) reverses the direction of the arrowheads.

The LAYER option controls which of the existing items in the plot will be overlaid by the arrows. By default, they overlay all the previous items.

Options: WINDOW, COORDINATETYPE, YUPPER, XUPPER, ISTYLE, ESTYLE, ISIZE, ESIZE, IANGLE, EANGLE, LAYER.

Parameters: IY, IX, EY, EX, COLOUR, LINESTYLE, THICKNESS, TRANSPARENCY.

Action with RESTRICT

Restrictions are ignored.

See also

Procedures: DERRORBARDFRTEXT, DREFERENCELINE, DTEXT.
Commands for: Graphics.

Example

CAPTION   'DARROW examples'
PEN       1; SYMBOL=0
CALCULATE [SEED=467585] (X,Y)[1] = GRUNIFORM(200;0;9)
CALCULATE (X,Y)[2] = (X,Y)[1] + GRUNIFORM(NVALUES(X[1]);-1;1)
DGRAPH    [WINDOW=3; KEY=0; TITLE='Random vectors'] Y=!(1,9); X=!(1,9)
DARROW    [WINDOW=3; ESTYLE=closed] IY=Y[1]; IX=X[1]; EY=Y[2]; EX=X[2]

CALCULATE x1,x2 = 1,8 * COS(C('radians') * !(0,5...355))
CALCULATE y1,y2 = 1,8 * SIN(C('radians') * !(0,5...355))
DGRAPH    [WINDOW=3; KEY=0; TITLE='Circle of arrows'] Y=!(-9,9); X=!(-9,9)
DARROW    [WINDOW=3; ESIZE=1.5; EANGLE=30] IY=y1; IX=x1; EY=y2; EX=x2
DLOAD     "Reset graphics"

VARIATE   x,y; VALUES=!(-1,1,1,-1),!(-1,-1,1,1)
CALCULATE xi,xo,yi,yo = 2(x,y)*0.92,1.2,0.92,1.1
FRAME     3; BOX=omit
XAXIS     3; action=hide
YAXIS     3; action=hide
PEN       1; SYMBOL=2; SIZE=2; CFILL='black'; labels=!T(A,B,C,D)
DGRAPH    [WINDOW=3; KEY=0; TITLE='Balanced loop design'] Y=y; X=x
DARROW    [WINDOW=3; ESTYLE=closed; ESIZE=3]\ 
          IY=yi; IX=xi; EY=CIRC(yi; 1); EX=CIRC(xi; 1);\ 
          COLOUR='red'; THICKNESS=3
DARROW    [WINDOW=3; ESTYLE=closed]\ 
          IY=yo; IX=xo; EY=CIRC(yo;-1); EX=CIRC(xo;-1);\ 
          COLOUR='green'; THICKNESS=3
DLOAD     "Reset graphics"
Updated on September 2, 2019

Was this article helpful?