Alphabetical list Categories
qgline Generalized line drawing
Help text:

qgline(ptspec1, ptspec2, ...).
A PTSPEC is a cell array containing a sequence of commands from the following list:

       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.
       AT id - Absolute paper coordinates of location set by AT.
       ATX id - Absolute paper x-coordinate of location set by AT.
       ATY id - Absolute paper y-coordinate of location set by AT.

For instance,

         qgline({'absdata', 0, 1, 'relpaper', 5, 0}, ...
                       {'absdata', 2, 3, 'relpaper', 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 qgline makes qline and qplot more attractive for general usage. The same applies to qgarea versus qarea and qpatch. See also qshiftedline and QGLINE2.

Example:

qfigure('qgline', 3, 3);

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

yy=cos(xx);

qmarker o solid

qmark(xx, yy);

N=length(xx)-1;

for n=1:N

    qgline({'absdata',xx(n),yy(n), 'retract', 10}, ...

            {'absdata',xx(n+1),yy(n+1), 'retract', 10});

end

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