LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reordering multiplots

Hi,
Is there any straightforward way to re-order the elements in an array of cluster of (array of double, array of double)? That is, I am generating a multiplot xy graph, and each plot corresponds to a different voltage level, each point in each plot corresponds to a different frequency. Is there some way to reorder this data structure so that each plot corresponds to a different frequency, and each point in each plot corresponds to a different voltage?

The data structure is created from two nested for loops, the inner one looping through frequencies and the outer looping through voltages. I'm aware that swapping which loop is inside which will allow me to generate such a data structure, but I want both constant-frequency and constant-voltage pl
ots, so I would still have the same problem.

Thanks,
Leo
0 Kudos
Message 1 of 6
(2,901 Views)
Have you tried just to transpose your 2D array? Its in the array palette.
0 Kudos
Message 2 of 6
(2,901 Views)
That would be nice if I could then convert the 2D array to an array of cluster of (array, array). This would be possible of the array-to-cluster function converted an n-dimensional array to a cluster of n-1 dimensional arrays, except it does not - it can only operate on 1D arrays.

Any other ideas?
0 Kudos
Message 3 of 6
(2,901 Views)
Well, tell us a little more about how your data is structured. Could you attach a simple example?

I was under the (maybe wrong) impression that the voltages and frequencies form a regular grid, epsecially since you generate it in two nested FOR loops. In this case you would not need an xy-graph, just a regular waveform graph with the "offset&multiplier" adjusted according to the grid spacing. Transposing would select which dimension to graph.
0 Kudos
Message 4 of 6
(2,901 Views)
Alright, here's what's done:
A GPIB arbitrary waveform generator is sent the (frequency, voltage) pair in the loop body. The outer loop goes over voltages and the inner loop goes over frequencies (this minimizes the number of times the AWG has to switch which attenuator it uses, which has to do with what its voltage output is. By changing voltage less often than frequency, the relays won't switch as much.)
Two GPIB multimeters measure voltages which constitute a Vin and Vout from any type of circuit to be characterized (filter, op amp, etc). This way, you can measure the gain as related to frequency and input voltage.
It would be nice to plot gain versus frequency with lines of constant voltage level. This is done by taking the voltage f
rom the inner loop out into the body of the outer loop, with indexing on, which gives me two arrays of voltages. Their ratio is gain; the gain array is clustered with the frequency array from the inner loop. This cluster of two arrays constitutes a single xy plot. By taking this cluster out of the outer loop with indexing on, I get an array of cluster of two arrays, which is an xy multiplot, which I feed directly to an xy graph.
I would also like to generate a graph of Vout versus Vin with lines of constant frequency. I just can't figure it out though.

Hope this helps?
-Leo
0 Kudos
Message 5 of 6
(2,901 Views)
I've figured out how to do this:
It turns out that an array of cluster of (double, double) is also a single plot. To make a multiplot, one makes a cluster array of plots; that is, an array of cluster of array of (double, double) is a multiplot.
It is possible to turn a 2D array into a cluster array of array by taking the 2D array into a for loop with indexing on, the body of the loop containing a bundle function, and then taking the output of the bundle of single array out with indexing on to make an array of cluster of array.
My problem was solved by clustering the (x,y) points in the innermost for loop, taking the cluster out of both loops with indexing on for both to have a 2D array, transposing, and then turning into a
cluster array as described.
0 Kudos
Message 6 of 6
(2,901 Views)