Hi,
Is there a way to implement log scaling in qwt 5.x? small code pieces will be appreciated?
Thanks,
Hi,
Is there a way to implement log scaling in qwt 5.x? small code pieces will be appreciated?
Thanks,
The bode example in the Qwt package has a logarithmic scale.
HTH,
Uwe
Thanks Uwe,
Is there a way set the starting point to log scale. It starts at a very small number at default. But I want to start from 0. I couldnt find a suitable function..
Thanks in advance..
10 -> 1 -> 0.1 -> 0.01 -> ... -> 0.0: try to fill the missing steps and you will understand, why the scale doesn't start at 0.0.
The engine for logarithmic scales accepts values in the range [1.0e-100, 1.0e100]. If you really need a scale starting from 0, you can derive your own "irregular" QwtScaleEngine, where you need to add some special rules for the range fom 0.0 to the value, where the regular scale starts.
Another (much easier) option is to display a "0" as label for the first small value.
Uwe
Hi Uwe,
I have a plot which ranges from 0 to 1024. I want to change the scale of the axis. 10*log0 = 0 and 10*log1024 = 30.. But the scale starts from 1*e-3 and ranges to 3. That shows most of the data at the rightest side of the plot window. it looks bad. I just want to set a beginning and finishing point to that axis.
What is the easiest way. I dont want to derive the class if i dont have to.
Thanks in advance,
Hi Uwe,
Before i send my implementation, i want to be make sure about something. As you said, the default behaviour of logScaled plotting starts at e-100. I want to know that whether i can set a range to the axis. For example, i want to plot between 10, 100 in x-axis.
Shortly, There is a setAxisScale method of QwtPlot. can i use this method after log scaled axis? i didnt try it yet. I just thought it. what do you think?
Thanks..
With QwtPlot::setAxisScale you assign a range and a step size for a specific axis scale. This is passed to YourScaleEngine::divideScale(...) to calculate ( align, divide) a valid scale ( min, max + tick positions ) from it.
So the answer to your question is: it depends on your implementation of YourScaleEngine::divideScale.
Uwe
Bookmarks