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).
Bookmarks