{
tab_x[0] = 0; (----) to tab_x[10] = 4096;
tab_y[0] = gamma(Tab_x[0]) = 0 to tab_y[10] = gamma(Tab_x[10]) (= 1024)
setAxisScale
(QwtPlot::xBottom,
0.0,
4200,
100);
setAxisScale
(QwtPlot::yLeft,
0.0,
1050.0,
100);
axisScaleDraw
(QwtPlot::xBottom)->setLabelRotation
(90);
axisScaleDraw
(QwtPlot::xBottom)->setLabelAlignment
(Qt
::AlignRight);
curve
->setPen
(QColor(Qt
::red));
curveFitter->setFitMode(curveFitter->ParametricSpline);
curveFitter->setSplineSize(100);
curve->setCurveFitter(curveFitter);
curve->setData(tab_x, tab_y, sizeof(tab_x) / sizeof(tab_x[0]));
curve->attach(this);
replot();
}
Plot::Plot(QWidget *parent):
QwtPlot(parent)
{
tab_x[0] = 0; (----) to tab_x[10] = 4096;
tab_y[0] = gamma(Tab_x[0]) = 0 to tab_y[10] = gamma(Tab_x[10]) (= 1024)
setAxisScale(QwtPlot::xBottom, 0.0, 4200,100);
setAxisScale(QwtPlot::yLeft, 0.0, 1050.0,100);
axisScaleDraw(QwtPlot::xBottom)->setLabelRotation(90);
axisScaleDraw(QwtPlot::xBottom)->setLabelAlignment(Qt::AlignRight);
setAxisFont(QwtPlot::xBottom,QFont("MS Shell Dlg 2",9));
curve = new QwtPlotCurve();
curve->setStyle(QwtPlotCurve::Lines);
curve->setCurveAttribute(QwtPlotCurve::Fitted, true);
curve->setPen(QColor(Qt::red));
curve->setSymbol(QwtSymbol(QwtSymbol::Cross,Qt::gray,QColor(Qt::red), QSize(8, 8)));
curveFitter = new QwtSplineCurveFitter();
curveFitter->setFitMode(curveFitter->ParametricSpline);
curveFitter->setSplineSize(100);
curve->setCurveFitter(curveFitter);
curve->setData(tab_x, tab_y, sizeof(tab_x) / sizeof(tab_x[0]));
curve->attach(this);
replot();
}
To copy to clipboard, switch view to plain text mode
Bookmarks