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.
Code:
(plot
->setAxisScaleEngine
(QwtPlot::xBottom,
new QwtLogScaleEngine
(10));
)
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?
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