4 Attachment(s)
Re: problem in : QwtPlotCurve::Fitted
Hi All,
i am facing the problem while implementing the setCurveAttribute(QwtPlotCurve::Fitted,true) for my curve...
i wanted to create a smooth curve... for that purpose...i just added the curve attribute setCurveAttribute(QwtPlotCurve::Fitted,true)... but the resulting curve is not same with excel created smooth curve(just for comparison)... is there any problem(bug) on setCurveAttribute(QwtPlotCurve::Fitted,true)????
i am here giving my code snippet...
QwtPlotCurve *defaultcurve = new QwtPlotCurve(curveName);
QwtSplineCurveFitter *curveFitter;
defaultcurve->setLegendAttribute(QwtPlotCurve::LegendShowSymbol ,true);
#if QT_VERSION >= 0x040000
defaultcurve->setRenderHint(QwtPlotItem::RenderAntialiased);
#endif
pen.setColor(clr);
QwtSymbol *symbol = new QwtSymbol(QwtSymbol::Ellipse, Qt::NoBrush,QPen(clr), QSize(4,4));
defaultcurve->setSymbol(symbol);
defaultcurve->setPen(pen);
defaultcurve->setStyle(QwtPlotCurve::Lines);
defaultcurve->setCurveAttribute(QwtPlotCurve::Fitted,true);
curveFitter = new QwtSplineCurveFitter();
defaultcurve->setCurveFitter(curveFitter);
defaultcurve->attach(this);
defaultcurve->setRawSamples(x, y, default_points);
please check with the attached images...
i have just created the same curve plots in Excel....for comparison purpose...
qwt plot curve as well as Excel plot curves are same if we use the straight lines...
but if we want to smooth the curve... then there is a difference in qwt plot curve and excel plot curves..
can any one please help me????????
Added after 1 36 minutes:
Hi ,
one thing i missed in my previous thread...
i am using qwt-6.0.0-rc5 and Qt 4.7.0 with Qt-creator2.0.1....
can any one please help me????????
Re: problem in : QwtPlotCurve::Fitted
There are many ways to interpolate curve points - Qwt offers 2 different types of spline interpolation.
When you think you have an unexpected/bad result please post a short demo application demonstrating the problem ( it is impossible to say something useful from these screenshots ).
No idea what type of interpolation your Excel did - but being like Excel was never intended.
Uwe
4 Attachment(s)
Re: problem in : QwtPlotCurve::Fitted
Hi Uwe,
thanks for your reply....
if you see & compare the attached images... (excelplot_stline.jpg,qwtplotcurve_line.jpg)...you can find the similarities...
but if we compare (excelplot_smoothline.jpg,qwtplotcurve_fitted.jpg) ... you can see some difference...
i used the "defaultcurve->setCurveAttribute(QwtPlotCurve::Fitted,true);" for interpolate the curve points...
but i am not getting the same result like excel which i am looking for...
here i am adding the source files of the respective classes...
can you please suggest me that what i need to do if i want the same interpolated smooth curve like excel..see the images(excelplot_smoothline.jpg,qwtplotcurve_fitte d.jpg)..?
Re: problem in : QwtPlotCurve::Fitted
Quote:
Originally Posted by
mammaiap
thanks for your reply....
Did you really read it ?
Again: if you are unhappy with the spline interpolation of the curve fitter be more specific, what you don't like ( don't tell me about Excel ).
If you want to have the same interpolation like in Excel you have to find out what Excel does ( ask the Excel developers ). Then I can tell if this is possible with Qwt.
Uwe