LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array of XY graphs

Solved!
Go to solution

I have a for loop. Inside the for loop there is an XY graph, whose indicator I have in the front panel. I would like to have the graph not inside the for loop, but outside, with indexing enabled. That is I would like an array of graphs, in order to have available ALL the graphs created (one for each iteration). But I am not able to create such an array of graph. I am able to create and indicator containing the data (it turns out to be a 2d array of cluster of 2 elements (2 1d array)). 

Is there any hope to have what I would like, that is the N graphs from the iterations of the loop?

0 Kudos
Message 1 of 7
(4,186 Views)
Solution
Accepted by topic author gnappo

Try to place the graph inside a cluster container before putting it in the array container, Also add a single-height bundle node right before the autoindexing output tunnel of the loop.

 

What datatype are your xy graphs? (array of cluster of points, cluster of x and y arrays, complex, etc.).

 

It would help if you could attach a small example of your code so we can see how you are constructing the graph data.

Message 2 of 7
(4,176 Views)

Thanks, I am going to try what you say.
The data are 1d array of clusters of 2 elements (which are 1d arrays), pink wires. Actually each graph is a plot of data with a fitting line on them.

0 Kudos
Message 3 of 7
(4,170 Views)

Also remember that array elements all share the same properties. Only the values are different. This means that all graphs with have the same axis range, same legend, same colors, etc., for example.

Message 4 of 7
(4,168 Views)

It works. You are a genius. Is it just a trick or is there a deep reason why it works?

0 Kudos
Message 5 of 7
(4,128 Views)

The deep reason is understanding why your original idea does not work. 🙂

 

Graphs take all kinds of data as I already mentioned. and unless you isolate the data into a cluster, many things will be ambiguous.

 

An easier example is a waveform graph that takes a 1D array for a single plot or a 2D array for multiple plots. So if you were allowed to have an array of graphs and feed it a 2D array, it would not be able to tell if you want a single array element containing a graph with multiple plots or an array of graphs with one curve each. It's ambiguous. For the same reason you cannot place an array inside an array, for example.

 

An "array of clusters" is always allowed, and if the cluster contents are valid data structures for your type of graph, you are OK.

Message 6 of 7
(4,123 Views)

It work for me, thanks. Cat Very Happy

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