Results 1 to 2 of 2

Thread: Scaling is not work Properly in Qwt Plot Library whenever X axis has LOG scale.

  1. #1
    Join Date
    Dec 2017
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Scaling is not work Properly in Qwt Plot Library whenever X axis has LOG scale.

    Hi

    Graph is not scale to one of the condition in Qwtplot Library. Even If will call the replot then also scale is not scale properly.
    I am able to generate that issue in only one condition.

    Here the step to regenerate the same issue.

    1) Create the Plot using QwtPlot.
    2) attache two Curver QwtPlotCurve.
    - Curve1 : Use QwtPlot::xBottom and QwtPlot::yLeft
    - Curve2: Use QwtPlot::xBottom and QwtPlot::yRight.

    3) Now plot the graph.
    4) Turn ON the Log on X axis.
    Qt Code:
    1. (plot->setAxisScaleEngine(QwtPlot::xBottom, new QwtLogScaleEngine(10));)
    To copy to clipboard, switch view to plain text mode 
    5) detach the Curve 2.
    6) add another set on Curve 1.(basically 3rd curve on X and YLeft).



    X axis scale from 1-e100 to 1e+20.

    If I will not detach the curve 2 then plot scaling is correct on X axis 100 to 1e+06.

    What are the change do I need to make?
    Last edited by yashkumar; 27th March 2020 at 21:06.

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

    Default Re: Scaling is not work Properly in Qwt Plot Library whenever X axis has LOG scale.

    In case of using autoscaling ( the default, when not calling setAxisScale manually ) the scale ranges are calculated from the bounding rectangles of all plot items, where the QwtPlotItem::AutoScale flag is enabled. As this is the default setting for all curves the scale should depend in your case on the bounding rectangle of your curves. The bounding rectangle of a curve is usually calculated by using the value from the corresponding QwtSeriesData object.

    Note that the data object caches this rectangle ( QwtSeriesData::d_boundingRect ) that might be a reason for problems, when points are changed behind the back of the data object.

    The calculation is done in QwtPlot::updateAxes(), what is called from QwtPlot::replot(). When using the debugger you should be able to identify what is going wrong.

    Please let me know, what you find out,
    Uwe

Similar Threads

  1. Changing the scale of axis in a plot
    By rradjabi in forum Qwt
    Replies: 3
    Last Post: 15th October 2015, 00:58
  2. Replies: 2
    Last Post: 19th November 2012, 16:29
  3. Scale Breaks in the QWT plot axis
    By OzQTNoob in forum Qwt
    Replies: 1
    Last Post: 10th May 2012, 10:38
  4. QGraphicsView::scale does not work properly.
    By metdos in forum Qt Programming
    Replies: 1
    Last Post: 18th January 2010, 09:58
  5. qwp plot axis scale
    By Cal in forum Qwt
    Replies: 1
    Last Post: 11th May 2009, 18:10

Tags for this Thread

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.