LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Autoscaling a graph drawn using the picture tools

In LabVIEW 7.1, I'm graphing data using the picture control and picture tools ("Calc Scale Specs.vi", "Draw Scale.vi", etc.).  I need to do something akin to autoscaling but I can't seem to come up with a good autoscaling algorithm.  Does anyone have a good autoscaling system in which I can give a range for the data (data-min, data-max) and it returns a good looking graph range (scale-min, scale-max).  I don't want to make any assumptions about the data, so the algorithm should work equally well with data ranging from 1.00001 to 1.0005 and data ranging from -1.0001 to 5E+6.  Thanks in advance.

- Jim Cavera
   j_cavera@yahoo.com

0 Kudos
Message 1 of 3
(2,483 Views)
It seems trivial at first, but it isn't. This is in fact difficult. (If you
don't optional "loose fit" like functionality, it get's a little easier. But
it still is difficult.)

Easiest way is to (mis)use a LabVIEW graph's scale. Make the graph the right
size. Put your data (subset) in a dummy graph, let it autoscale, and read
it's scaling values. All with the graph's properties.

Regards,

Wiebe.


0 Kudos
Message 2 of 3
(2,477 Views)
Btw. If you create a Min-Max Plot Indicator (in Graph>Controls), you can
open the VI that LabVIEW created. In it, you'll find the Autoscale XY.vi.
It's far from perfect (the way it is build), but it does the job. You can
study it (and build something better), or copy it's hierarchy and change it
to suit your needs.

Regards,

Wiebe.


0 Kudos
Message 3 of 3
(2,476 Views)