Results 1 to 3 of 3

Thread: QwtSplineCurveFitter and auto scale

  1. #1
    Join Date
    Oct 2019
    Posts
    10
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QwtSplineCurveFitter and auto scale

    Hello,

    I use the QwtSplineCurveFitter for my data and it seems that the auto scale does only take the plot points into consideration, not the temporary points from the fit curve:

    PlotSpline.png

    Is there a way to auto scale the y axis in a way that the whole fit curve is visible?

    Oh, btw we use Qwt 6.1.4.

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

    Default Re: QwtSplineCurveFitter and auto scale

    The curve fitter is part of the rendering that happens after autoscaling, when points have already been translated to paint device coordinates. So you probably have to process the spline interpolation manually and pass the result as curve points - what of course does not work well with logarithmic scales.

    Please note that Qwt 6.2 offers various sorts of spline interpolation/approximation algos. As the cubic spline algo ( the only one available with Qwt 6.1 ) is expensive and prone for overshooting I would use a different one: see: https://qwt.sourceforge.io/class_qwt_spline.html You can have a look at the splineeditor example to compare the effect of the available algos.

    Manual interpolation/approximation can be done using https://qwt.sourceforge.io/class_qwt...b757c87f8ac21d. But you can probably avoid doing it when using an algo, that does not overshoots that much and giving the plot some extra space at the borders: https://qwt.sourceforge.io/class_qwt...c60ab1597b1203

    HTH,
    Uwe

  3. #3
    Join Date
    Oct 2019
    Posts
    10
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QwtSplineCurveFitter and auto scale

    Thank you. I switched to qwt 6.2 and the default spline both, "looks better" and has less (actually none at all) overshooting areas.

Similar Threads

  1. Replies: 1
    Last Post: 9th September 2013, 08:50
  2. Auto scale with margin
    By mqt in forum Qwt
    Replies: 4
    Last Post: 12th August 2013, 09:40
  3. Axis Auto Scale
    By gkarthick5 in forum Qwt
    Replies: 3
    Last Post: 13th July 2011, 14:57
  4. Auto scale a QGraphicsView
    By niluje in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2011, 00:43
  5. 4 axis auto scale..
    By Vincenzo in forum Qwt
    Replies: 0
    Last Post: 22nd March 2009, 02:12

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.