Results 1 to 6 of 6

Thread: qwtpolar radius scale step always autosteps regardless of setting

  1. #1
    Join Date
    Mar 2014
    Location
    USA
    Posts
    85
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default qwtpolar radius scale step always autosteps regardless of setting

    void CPolFileGraph::SetupPolarPlot()
    {

    m_pPolarPlot = new QwtPolarPlot(ui.m_frame_Graph);
    if(m_GraphSettings.GetAzimuthRange() == AZIMUTH_NEG_180_TO_180)
    {
    m_pPolarPlot->setScale(QwtPolar::Azimuth,180.0,-180.0,m_GraphSettings.GetAzimuthLabeling());
    m_pPolarPlot->setAzimuthOrigin(3 * M_PI_2);
    }
    else
    {
    m_pPolarPlot->setScale(QwtPolar::Azimuth,360.0,0.0,m_GraphSetti ngs.GetAzimuthLabeling());
    m_pPolarPlot->setAzimuthOrigin(M_PI_2);
    }
    m_pPolarPlot->setScale(QwtPolar::Radius,-40,40,2.0);
    bool AutoScaleOn1 = m_pPolarPlot->hasAutoScale(Qwt::Azimuth); // returns false showing auto scale is off
    bool AutoScaleOn2 = m_pPolarPlot->hasAutoScale(QwtPolar::Radius); // returns false showing auto scale is off
    m_PolarPlotGrid.showGrid(QwtPolar::Azimuth,true);
    m_PolarPlotGrid.showGrid(QwtPolar::Radius,true);
    m_PolarPlotGrid.showAxis(QwtPolar::AxisAzimuth,tru e);
    m_PolarPlotGrid.showAxis(QwtPolar::AxisBottom,fals e);
    m_PolarPlotGrid.showAxis(QwtPolar::AxisLeft,false) ;
    m_PolarPlotGrid.showAxis(QwtPolar::AxisRight,true) ;
    m_PolarPlotGrid.showAxis(QwtPolar::AxisTop,false);
    m_PolarPlotGrid.attach(m_pPolarPlot);
    m_pPanner = new QwtPolarPanner(m_pPolarPlot->canvas());
    m_pPanner->setEnabled(true);
    m_pMagnifier = new QwtPolarMagnifier(m_pPolarPlot->canvas());
    m_pMagnifier->setEnabled(true);
    }

    I set up a polar plot with the above code. When I set the radius scale I set step to 2. I check to see if autoscale is on for Azimuth and Radius, Azimuth is off and Radius is on. I don't want it to be on. My radius axis seems to auto step the plot even though I set it for 2. In this case I get a step of 10 instead of 2. Am I doing something wrong or is it a bug in QwtPolar? Just for the heck of it I tried setting the step to 20 and still get the same result, it sets to 10.

    Edit starts here.
    OK, I screwed up on checking if autoscale is on/off. I fixed the code. It shows that autoscale is turned off for both axis, but the radius axis displays autoscale instead of the step I manually entered (F.e. 10.0 instead of 2.0 in the above code).
    Last edited by TonyInSoMD; 19th March 2015 at 12:54.

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

    Default Re: qwtpolar radius scale step always autosteps regardless of setting

    It shows that autoscale is turned off for both axis, but the radius axis displays autoscale instead of the step I manually entered (F.e. 10.0 instead of 2.0 in the above code).
    Not here with your code snippet. But the code in QwtPolarPlot is that simple, that you could easily use the debugger to check what goes wrong in your setup.

    Uwe

  3. #3
    Join Date
    Mar 2014
    Location
    USA
    Posts
    85
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qwtpolar radius scale step always autosteps regardless of setting

    I tried changing the code in the demo (polardemo) that comes with qwtpolar and it still doesn't work. In the Plot constructor I changed this line in the code
    setScale(QwtPolar::Radius,radialInterval.minValue( ), radialInterval.maxValue())
    which sets it up to autoscale the division lines to
    setScale(QwtPolar::Radius,radialInterval.minValue( ), radialInterval.maxValue(),8) but the scale division lines don't change, they stay at the autoscale division line values. I also tried 1.0 and 5.0 with no change. This is using the code that comes with qwtpolar as an example. I'm starting to firmly believe it's a bug. I mean it still does it when using code that supposedly works perfectly and changing one parameter, that should turn off autoscale and make it change to a user set value. Where does one report a bug?

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

    Default Re: qwtpolar radius scale step always autosteps regardless of setting

    I tried changing the code in the demo (polardemo) that comes with qwtpolar and it still doesn't work.
    When looking at your first posting you wrote, that "hasAutoScale(QwtPolar::Radius)" returns true after doing a "setScale(QwtPolar::Radius,-40,40,2.0);". This is what I checked and I can't confirm.

    In the Plot constructor I changed this line in the code
    setScale(QwtPolar::Radius,radialInterval.minValue( ), radialInterval.maxValue())
    which sets it up to autoscale the division lines to setScale(QwtPolar::Radius,radialInterval.minValue( ), radialInterval.maxValue(),8) but the scale division lines don't change,.
    Of course they doesn't change as you are using exactly the same parameters as what the autoscaling operation comes up with.

    Guess you simply forgot to increase the maximum for the major steps: try

    Qt Code:
    1. setScaleMaxMajor( QwtPolar::Radius, 40 );
    2. setScale( QwtPolar::Radius, -40,40, 2.0 );
    To copy to clipboard, switch view to plain text mode 
    and you will see an effect - event if probably not the one you want to have.

    Where does one report a bug?
    You already have my attention.

    Uwe

  5. The following user says thank you to Uwe for this useful post:

    TonyInSoMD (19th March 2015)

  6. #5
    Join Date
    Mar 2014
    Location
    USA
    Posts
    85
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Thumbs up Re: qwtpolar radius scale step always autosteps regardless of setting

    Inserting
    setScaleMaxMajor( QwtPolar::Radius, 40 );
    into the code fixed the problem. It works exactly as I wanted it to. Thanks!!!

  7. #6
    Join Date
    Jan 2021
    Posts
    3
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qwtpolar radius scale step always autosteps regardless of setting

    Hello,
    I also had similar problems with the QwtPolar::Radius scale steps.
    The solution : disabling the auto-scaling attribute of the QwtPolarGrid :
    ... .setGridAttribute( QwtPolarGrid::AutoScaling, false );

Similar Threads

  1. Setting QT in Xcode step by step guide
    By anupam in forum Qt Programming
    Replies: 2
    Last Post: 29th September 2015, 19:06
  2. QwtPolar - Title for Radius Axis
    By Crowley in forum Qwt
    Replies: 3
    Last Post: 23rd May 2014, 07:14
  3. Replies: 1
    Last Post: 13th August 2012, 11:32
  4. Replies: 7
    Last Post: 13th April 2011, 08:42
  5. QwtPolarPlot radius scale
    By brutus35 in forum Qwt
    Replies: 2
    Last Post: 24th February 2011, 17:46

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.