.TH CURVEFIT PL "Ploticus data display engine"
 
.ig >>
<center>
<b>Ploticus data display engine</b> <small><a href="Copyright.html">Copyright Steve Grubb</a><br></small><br>
<a href="../doc/Welcome.html"><img src="../gallery/btn/welcome.gif"></a>
<a href="../gallery/index.html"><img src="../gallery/btn/gallery.gif"></a>
<a href="../doc/Contents.html"><img src="../gallery/btn/handbook.gif"></a>
<br><h1>Proc Curvefit</h1>
</center>
.>>

.SH NAME
proc curvefit

.ig >>
<center>
<img src="../gallery/curvefit0.gif">
</center>
.>>
.PSPIC ../gallery/curvefit1.eps

.SH DESCRIPTION
.LP
\fBproc curvefit\fR fits a curve to the data and renders
the curve with a line.

.SH FEATURES
Two types of curve calculation are available: moving average
and bspline.
Also, complete control over color, width, and dash style of line.

.SH EXAMPLES
See the Gallery curvefit examples
.ig >>
<a href="../gallery/gall.curvefit.html"><img src="../gallery/btn/here.gif"></a>
.>>

.SH PREREQUISITES
A plotting area must be set up using \fBproc areadef\fR 
and \fBproc getdata\fR must be executed to 
access or define some data.
As with \fBproc lineplot\fR, the data must be ordered in X.

.SH MODES
Like \fBproc lineplot\fR, data may be given for both X and Y 
or just for Y.  In the latter case, sequential unit locations are
used for the X component.

.SH MANDATORY ATTRIBUTE
The \fCyfield\fR attribute MUST be specified.

.SH ATTRIBUTES
.LP
\fByfield\fR 
.ig >>
<a href="attributetypes.html#dfield">
.>>
\fI dfield \fR
.ig >>
</a>
.>>
.IP
Data field to use for Y values.
Example: \fCyfield: 1\fR

.LP
\fBxfield\fR 
.ig >>
<a href="attributetypes.html#dfield">
.>>
\fI dfield \fR
.ig >>
</a>
.>>
.IP
Data field to use for X values.
If not given, sequential unit locations in X will be used.
Example: \fCxfield: 4\fR

.LP
\fBcurvetype\fR \fCmovingavg\fR | \fCbspline\fR
.IP
The type of curve fitting computation to perform.
Example: \fCcurvetype: movingavg\fR

.LP
\fBorder\fR \fIn\fR
.IP
For bspline curves, this is a value between 2 and 20; a lower value
yields a more jagged curve, while a higher value gives a smoother curve.
The number of data points must be at least this value for a bspline curve
to be possible.
.IP
For moving average curves, this defines the number of points
to include in each average computation.
.IP
Default order for either type of curve is 4.
.IP
Example: \fCorder: 8\fR

.LP
\fBlinedetails\fR 
.ig >>
<a href="linedetails.html">
.>>
\fI linedetails \fR
.ig >>
</a>
.>>
.IP
Rendering details for the curve.
Example: \fClinedetails: color=red width=2.0 style=2\fR

.LP
\fBcalcrange\fR \fImin\fR [\fImax\fR]
.IP
Data within this range will be included in curve calculation.
If only one value is given, it will be taken as the range
minima and the maxima will be the plottable maxima.
If not specified all data rows will be included.

.LP
\fBlinerange\fR \fImin\fR [\fImax\fR]
.IP
Controls the range (in scaled units) within which the curve will be rendered.
Data points falling outside this range will not be rendered.
If accumulation is being done, points outside the range will contribute
to the accumulated total.
If only one value is given, it will be taken as the range
minima and the maxima will be the plottable maxima.
If not specified all data rows will be plotted.
Example: \fClinerange: 1\fR

.LP
\fBlegendlabel\fR  
.ig >>
<a href="attributetypes.html#text">
.>>
\fI text \fR
.ig >>
</a>
.>>
.IP
A label to be associated with the curve in the legend.
\fBproc legend\fR must be executed later in order to
render the legend.
 
