Alphabetical list Categories
qgline2 Generalized line drawing
Help text:

qgline(cmd1, args1, cmd2, args2, ...) specifies a line in mixed data and paper coordinates.
Commands are given as (lower case) strings and are followed by zero or more vector arguments, depending on the command. All vectors must be the same length. However, scalars will be automatically converted to vectors of the appropriate length.
Commands with their arguments are:

       ABSDATA x y - Absolute data coordinates
       RELDATA dx dy - Relative data coordinates
       ABSPAPER x y - Absolute paper coordinates (in pt)
       RELPAPER dx dy - Relative data coordinates (in pt)
       ROTDATA xi eta - Rotate by atan2(eta, xi) in data space.
                                         (This affects subsequent relative positioning.)
       ROTPAPER phi - Rotate by phi radians. (This affects subsequent
                                         relative positioning.)
       RETRACT l - Retract preceding and following segments by L pt.
       RETRACT l1 l2 - Retract preceding and following segments by L1 and
                                         L2 pt respectively.

For instance,

           qgline2('absdata', [0 2], [1 3], 'relpaper', [5 0], [0 7])

Draws a line from 5 pt to the right of the point (0, 1) in the graph to 7 pt below the point (2, 3) in the graph. (Note that paper y-coordinates increase toward the bottom of the graph while data y-coordinates increase toward the top.)

Note: The rather cumbersome syntax of qgline2 makes qline and qplot more attractive for general usage. The same applies to qgarea versus qarea and qpatch. See also qshiftedline and qgline.

Example:

qfigure('qgline2', 3, 3);

xx=[-1.5*pi:1.5*pi];

yy=cos(xx);

qmarker o solid

qmark(xx, yy);

qgline2('absdata',xx,yy, 'retract', 10);

QPlot Documentation — (C) Daniel Wagenaar, 2014–2019