LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fit scale/autoscale y-axis of XY-Graph only considerig points within range of x-scale

Hello,

 

I've a problem with some XY-Graphs. I want to fit the y-scale to data when pushing a button. My problem is, when using a property node setting YScale.ScaleFit to 1 the y-scale is fitted to the whole data stored in the XY-Graph and not only to the visible data. I would like LabVIEW only to consider data points within the range of the x-scale. Do you know any solution, except calculating the maximum and minimum of the data-points within the range of the x-scale and then adjusting the scales?

 

Regards,

eme

0 Kudos
Message 1 of 9
(6,534 Views)
You can remove every thing from the graph except what you are trying to scale. That would be another way to do that.
Tim
GHSP
0 Kudos
Message 2 of 9
(6,528 Views)

OK this would be another way to do that. Am I guessing right that LabVIEW has no built in function that could solve my scaling problem?

 

Regards,

eme

0 Kudos
Message 3 of 9
(6,523 Views)

Not to my knowledge.  If you bent on using the auto-scale feature, and your data set is not abnormally large, you could put it in a sub-VI, and auto-scale X and Y.  Then read the values of Y out.  But if you are building an application, you may need to insure to include the FP diagram of the sub. 

My solution would be to take the max/min of the input data set.  Round that to a suitable range for your application and write that to the Y min and max values.  Voila, your own autoscale routine.


Paul
0 Kudos
Message 4 of 9
(6,509 Views)

Just to give this a poke...

 

So it is not possible to autoscale to only the visible data on an XY Graph? -the default is to autoscale to the whole data set, regardless of how much of it is actually displayed?

 

If the default is the only case, it seems a little inconsistent given:

1, there is a function to display only part of the dataset (X/YScale.range property node),

2, the autoscale function does autoscale if different plots are made visible/invisible.

 

Achieving autoscaling by editing the data set so that only data that you wish is displayed is in the data set sent to the graph (as suggested earlier in this thread) makes the functions 1 & 2 above redundant.... ?

 

 

This also appears to be different to Waveform Chart behaviour, which does autoscale to what is visible. This is despite the Waveform Chart retaining data which is not necessarily displayed (eg. if 'Chart History Length' is larger than X axis max - X axis min).

 

...or have i just missed a property node somewhere?

 

Blue

0 Kudos
Message 5 of 9
(6,082 Views)

Hm, I just stumbled upon the same issue (LabView 2012) and it is indeed a very annoying one.

It would've been great if there were an easier solution than writing one's own autoscaling routines...

 

 

 

 

0 Kudos
Message 6 of 9
(5,302 Views)

+1, that's very irritating.
Hope NI will improve this autoscale to effective displayed data (or let the user choose which one scale method to use)

0 Kudos
Message 7 of 9
(5,269 Views)

-2 (!)

 

On the other hand, if you write your own autoscaling routine (which can be really simple), then you know exactly what is happening and why. You really only have to write the basic routine once. It's then much easier to tweak for specific situations than an NI-built autoscale, because NI has to please everybody and you only have to please yourself (and your boss/customer).

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 8 of 9
(5,265 Views)

+3 -1 = +2 (!)

The Waveform chart exhibits the desired behavior already, so the XY graph simply has a bug. Writing our own autoscale routine is the wrong solution just to fix a bug.

 


@camerond wrote:

-2 (!)

 

On the other hand, if you write your own autoscaling routine (which can be really simple), then you know exactly what is happening and why. You really only have to write the basic routine once. It's then much easier to tweak for specific situations than an NI-built autoscale, because NI has to please everybody and you only have to please yourself (and your boss/customer).

 

Cameron

 


 

0 Kudos
Message 9 of 9
(3,913 Views)