Add least-squares line to scatter plot

`lsline`

lsline(ax)

h = lsline(___)

`lsline`

superimposes a least-squares line
on each scatter plot in the current axes. Scatter plots are produced
by the MATLAB^{®} `scatter`

and `plot`

functions. Data points connected
with solid, dashed, or dash-dot lines (`'-'`

, `'--'`

,
or `'.-'`

) are not considered to be scatter plots
by `lsline`

, and are ignored.

`lsline(ax)`

superimposes a least-squares
line on the scatter plot in axis `ax`

.

`h = lsline(___)`

returns a column
vector of handles `h`

to the least-squares lines,
using any of the previous syntaxes.

Was this topic helpful?