LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does my Left Y-Axis on my graph keep autoscaling to 100?

This might be stupid, but its driving me crazy.  I'm trying to plot a set of data on a graph and I have the Y-Axis on Autoscale.  My data is in a range of 0 to .5, but the axis keeps scaling to 100.  When I plot data greater than 100, it autoscales fine, but data smaller than 100, like the data I'm trying to plot now, keeps showing up at Y-max = 100.  Is there an attribute I need to change or something to get the autoscale to change?
 
Jim
 
0 Kudos
Message 1 of 7
(4,270 Views)
Jim,
 
I couldn't say what exactly is wrong but here are a couple of things that you might want to check:
 
1.) make sure the autoscale is on the left-y-axis and not the right-y-axis.
 
2.) perhaps you are setting your data to be displayed in engineering units? 
 
3.) perhaps you have log scale turned on?
0 Kudos
Message 2 of 7
(4,265 Views)
Hi Fridge.

It looks like you have "loose fit" (ATTR_YLOOSE_FIT_AUTOSCALIN
G) set for the axis.

If you set the value of
ATTR_YLOOSE_FIT_AUTOSCALING_UNIT to 0, the maximum and minimum values on the axis will be multiples of 1 (= 10^0); if it is 2, they will be multiples of 100 (= 10^2).

You can set these attributes programmatically or in the UIR editor.

This is from the CVI help:

ATTR_YLOOSE_FIT_AUTOSCALING_UNIT

Type:

Control attribute

Description:

The base 10 logarithm of the loose fit factor. The loose fit factor determines how the maximum and minimum values of the scale are calculated when loose fit autoscaling is enabled. The maximum is the smallest multiple of the loose fit factor that is greater than or equal to the largest value of all plots. The minimum is likewise the largest multiple of the loose fit factor that is less than or equal to the smallest value of all plots.

For example, if the loose fit unit value is 1, the loose fit factor is 10. In that case, if the largest value of all plots is 41 and the smallest value of all plots is 27, the new maximum is 50 and the new minimum is 20.

Regards,
Colin.


0 Kudos
Message 3 of 7
(4,258 Views)
It looks like it was the loose fit.  I knew it was something simple.
 
Thanks,
Jim
0 Kudos
Message 4 of 7
(4,250 Views)

I'm waking up this old thread because I just had this problem. Reading the Loose Fit documentation, it seems that cdk52's explanation is wrong:

Examples where the loose fit unit is 1:
Largest value: 0.0567, new maximum: 0.06
Largest value: 5.678, new maximum: 6

 

Examples where the loose fit unit is 2:
Largest value: 0.0567, new maximum: 0.057
Largest value: 5.678, new maximum: 5.7

 

I have the same problem (only in linear, log works as expected) as the original poster:

My loose fit unit is 1:
My largest value: 5.678, new maximum: 10

My loose fit unit is 2:
My largest value: 5.678, new maximum: 100 (like OP)

My loose fit unit is 3:
My largest value: 5.678, new maximum: 1000 !!!

 

So it seems to contradict the documentation and act like cdk52 says after all !!! But it doesn't make sense to me, what would be the point of that behavior ? And I should add that I've used Loose Fit before without noticing this behavior.

 

Note: I have several hidden plots on my graph, but they are all below that largest value.

 

 

0 Kudos
Message 5 of 7
(3,688 Views)

Hello Guillaume,

 

The behavior you describe is indeed the expected behavior and cdk52's explanation is correct. Keep in mind that the examples from the documentation that you pasted here apply to log scales, and not linear scales. Using loose fit units with log scales is a bit more complicated and so a few more examples are provided in the documentation for log scales  (the linear scale case has only the 27/41 example).

 

You say that this linear scale behavior doesn't make sense to you, but keep in mind that these units can also be negative exponents. With negative exponents, you should see the following behavior:

 

loose fit unit is -1:
largest value: 5.678, new maximum: 5.7

 

loose fit unit is -2:
largest value: 5.678, new maximum: 5.68

 

loose fit unit is -3:
largest value: 5.678, new maximum: 5.678

 

Does that make more sense? If not, what was the behavior that you expected to see?

 

Luis

 

 

Message 6 of 7
(3,631 Views)

Haaa... it wasn't clear that the exemples applied only to the log scale.

0 Kudos
Message 7 of 7
(3,624 Views)