Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

log scale won't scale to show small values

I have very small values to scale... all peaks of less then .0005. No matter what I try, I cannot get a logorithmic scale to scale that small. Besides multiplying everything by 100000, is there anyway to get the axis to scale these properly?
 
The following code produces a graph with a vertical scale of 0-10:
 
WaveformGraph

yAxis1.ScaleType = ScaleType.Logarithmic;

yAxis1.LogBase = 10;

yAxis1.Range = Range.Parse("0,.001");

 
0 Kudos
Message 1 of 4
(4,868 Views)
Hi cju,

It appears as though when you apply the logarithmic scale, if you enter in any value less than 1 for the maximum range, the waveform graph defaults to 10. I am investigating this behavior further.

Does your data set contain values outside of the .001 maximum you are trying to specify? If you make sure the axis.mode property is not set to "fixed", and don't specify the range, does the scaling work properly?

I'll let you know what I find on my end. Thanks for your patience cju.

Dan Weiland
Applications Engineer
National Instruments
Dan Weiland
0 Kudos
Message 2 of 4
(4,854 Views)
The scaling always defaults to 1-10 even when not set to fixed. There are no values outside the range of the axis I am trying to plot. So for instance if my scale is (0,.001) my values are from 0 to .0005. Right now I have to set the graph to a normal scale but the customer must have a log scale.

I thought it had something to do with smaller values and log graphs in general so I tried to plot them in Excel and that scaled fine.
0 Kudos
Message 3 of 4
(4,850 Views)
The problem stems from trying to use the value 0 for the minimum of a logarithmic scale.
To fix this, you need to set the lower end of your range to a value close to, but greater than 0.

See the following forum post for more detailed information, and let us know if you are still having this problem.

http://forums.ni.com/ni/board/message?board.id=232&message.id=1103&requireLogin=False

Thanks cju, have a good one!

Dan Weiland
Applications Engineer
National Instruments
Dan Weiland
0 Kudos
Message 4 of 4
(4,834 Views)