PDA

View Full Version : set axis properties with sign(x)log|x|+1



yellowfisher
1st September 2015, 11:42
Now I want set y axis's properties with sign(x)log(|x|+1) ,but i found QwtLogScaleEngine class only supports log(x).
Should I inherit class QwtLogScaleEngine and overwrite function autoScale( ) and devideScale()?
Thanks for your help.

Uwe
1st September 2015, 13:31
I guess you have to derive from QwtScaleEngine, but probably there will be code in the implementation of QwtLogScaleEngine you have to copy out to your class as well.

I believe, that having a logarithmic scale engine, that is not limited to positive ranges would be a quite handy thing and I would like to
have such a thing in the Qwt library itself. If you are motivated to work in this direction please contact me by Email.

ciao,
Uwe

yellowfisher
2nd September 2015, 02:31
Thanks for your reply.
I will have a try and tell you the progress later.

yellowfisher
11th September 2015, 03:36
I guess you have to derive from QwtScaleEngine, but probably there will be code in the implementation of QwtLogScaleEngine you have to copy out to your class as well.

I believe, that having a logarithmic scale engine, that is not limited to positive ranges would be a quite handy thing and I would like to
have such a thing in the Qwt library itself. If you are motivated to work in this direction please contact me by Email.

ciao,
Uwe

I have spent some time on this project and till now I haven't get clear with the source code write in QwtScaleEngine class.
While I set
autoScale(int maxNumSteps, double &x1, double &x2, double &stepSize) const arguments x1 and x2 to negative numbers, then no curve will be plot. But I cant find where to remove this limit for negative range.
I set
linearInterval = linearInterval.limited(-LOG_MAX, LOG_MAX); in derived class and it dose nothing.
Appreciate your help.

Uwe
14th September 2015, 06:36
Start with the transformation - a class derived from QwtTransform - how to find the ticks or to align the scale boundaries is only the second step.

Uwe

yellowfisher
19th October 2015, 11:02
Start with the transformation - a class derived from QwtTransform - how to find the ticks or to align the scale boundaries is only the second step.

Uwe

I haven't work on this project for a long time since last reply.And recently I worked out something like this.The first picture is the data I set and it plots like the second picture.
It only has one step-(1,100), I think It's better to get two steps-(1, 10) and (10, 100), but I don't know how to make it.
11456
11457