Results 1 to 4 of 4

Thread: problem in : QwtPlotCurve::Fitted

  1. #1
    Join Date
    Feb 2010
    Posts
    28
    Qt products
    Qt4
    Platforms
    Windows

    Default 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????????
    Attached Images Attached Images
    Last edited by mammaiap; 1st February 2011 at 12:17.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default 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

  3. #3
    Join Date
    Feb 2010
    Posts
    28
    Qt products
    Qt4
    Platforms
    Windows

    Question 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)..?
    Attached Files Attached Files

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: problem in : QwtPlotCurve::Fitted

    Quote Originally Posted by mammaiap View Post
    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

Similar Threads

  1. QwtPlotCurve and QScrollArea
    By Fanwa in forum Qwt
    Replies: 1
    Last Post: 2nd December 2010, 07:49
  2. Replies: 4
    Last Post: 18th November 2010, 13:00
  3. Different symbol on a QwtPlotCurve
    By jomarin in forum Qwt
    Replies: 3
    Last Post: 24th March 2010, 10:27
  4. get the point of a fitted curve
    By giusepped in forum Qwt
    Replies: 1
    Last Post: 2nd January 2009, 04:03
  5. Get the points of a fitted curve
    By giusepped in forum Qwt
    Replies: 4
    Last Post: 25th December 2008, 07:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.