From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Making an intensity graph work with arrays of different sizes

Solved!
Go to solution


Here is my problem.  If I first load a 20x20 array of doubles into my intensity graph, this array takes up the entire field of view. If I later load a smaller 10x10 array, only a quarter of the field is occupied as shown below.  Conversely, if I load a larger array, not all of the contents are displayed

Is there any way that I can rescale this graph (for lack of a better term) to work with inputs of different sizes?

 

Ninjatrainee_1-1648523072935.png

 

0 Kudos
Message 1 of 7
(1,145 Views)

Set the x an y axis to autoscale.

0 Kudos
Message 2 of 7
(1,137 Views)

I tried setting XScale.ScaleFit and YScale.ScaleFit to 2. I also verified that autoscale is set on both axes.  That didn't do the trick.

0 Kudos
Message 3 of 7
(1,128 Views)

Please attach a simplified version of your vi. Preferably LabVIEW 2020 or older.

0 Kudos
Message 4 of 7
(1,120 Views)

Here is a simplified VI, as requested.  If you click on the toggle, you can see that one of the images occupies the entire graph, whereas the smaller one doesn't. This creates a problem for us when we attempt to load images of different sizes.

Any suggestions for how to approach this?  I tried a bunch of properties in the intensity graph, but none of them did the trick.

0 Kudos
Message 5 of 7
(1,081 Views)
Solution
Accepted by topic author Ninja-trainee

Turn off "loose fit" for both axes or change the axis formatting to show at least two decimal digits.

 

(With loose fit enabled, it will round to the nearest "nice" value for the limits, which is tricky with a 0.05 increment and markers limited to zero digit precision, i.e. whole numbers.)

0 Kudos
Message 6 of 7
(1,077 Views)

That did the trick. Thanks. I do have a problem with the x- and y-axes, but that's a separate issue that I'll raise later.  Again, thanks.

0 Kudos
Message 7 of 7
(1,057 Views)