halberdier83

1st November 2007, 07:18

Hi,

Is there a way to implement log scaling in qwt 5.x? small code pieces will be appreciated?

Thanks,

Is there a way to implement log scaling in qwt 5.x? small code pieces will be appreciated?

Thanks,

View Full Version : qwt 5 log scale..

halberdier83

1st November 2007, 07:18

Hi,

Is there a way to implement log scaling in qwt 5.x? small code pieces will be appreciated?

Thanks,

Is there a way to implement log scaling in qwt 5.x? small code pieces will be appreciated?

Thanks,

Uwe

1st November 2007, 21:27

The bode example in the Qwt package has a logarithmic scale.

HTH,

Uwe

HTH,

Uwe

halberdier83

6th November 2007, 11:42

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

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

Uwe

6th November 2007, 14:52

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

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

halberdier83

8th November 2007, 21:39

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,

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,

Uwe

8th November 2007, 23:05

I dont want to derive the class if i dont have to.

If you want a scale that is neither linear, nor log10, you have to implement its build rules as a QwtScaleEngine.

If you think your special scale engine is of common interest, send your implementation to me.

Uwe

If you want a scale that is neither linear, nor log10, you have to implement its build rules as a QwtScaleEngine.

If you think your special scale engine is of common interest, send your implementation to me.

Uwe

halberdier83

12th November 2007, 06:43

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

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

Uwe

12th November 2007, 07:21

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

So the answer to your question is: it depends on your implementation of YourScaleEngine::divideScale.

Uwe

Powered by vBulletin® Version 4.2.5 Copyright © 2019 vBulletin Solutions Inc. All rights reserved.