Products & Services Solutions Academia Support User Community Company

Learn more about Statistics Toolbox   

gline - Interactively add line to plot

Syntax

gline(h)
gline
hline = gline(...)

Description

gline(h) allows you to draw a line segment in the figure with handle h by clicking the pointer at the two endpoints. A rubber-band line tracks the pointer movement.

gline with no input arguments defaults to h = gcf and draws in the current figure.

hline = gline(...) returns the handle hline to the line.

Examples

Use gline to connect two points in a plot:

x = 1:10;

y = x + randn(1,10);
scatter(x,y,25,'b','*')

lsline

mu = mean(y);
hold on
plot([1 10],[mu mu],'ro')

hline = gline; % Connect circles
set(hline,'Color','r')

See Also

refline, refcurve, lsline

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS