07-29-2013 05:53 PM - edited 07-29-2013 05:56 PM
I have a cluster of single-plot xy graphs. The data is pulled from a file, assembled in a for loop, and passed to the graph cluster using the array to cluster function.
Now I need each graph to have multiple plots. The array that built the original data clusters of x and y arrays now must make arrays of these clusters, one for each plot. So, I tried passing these arrays into a cluster before pussing out of the for loop, but I can't get the graph cluster to accept the result. I've also tried indexing out a 3-D array and getting a 2-D array of graphs to accept this data, to no avail.
Any ideas?
I've made an attempt to create snippets, but it's my first time doing so, so thank you for your patience.
07-29-2013 06:10 PM
Can you attach these VIs?
Matt
07-29-2013 06:13 PM
Just looking at this, you can not pass a 2D array of clusters to a xy graph control. You need to flatten this data to 1D, so maybe have a shift register that contains the array and intialized with a null array and then keep adding to the array.
Matt
07-30-2013 01:17 AM
Thanks Matt, As you can see, I've tried a number of things. The 2-D array of clusters (of x and y arrays) was one attempt to write to a 2-D array of x-y graphs... no go!
I'm thinking the way to go it to write to a cluster or array of pngs.
07-30-2013 02:48 AM
The problem lies with the type definitions, they are single-plot XY graphs. You need to change them to multi-plot (array of clusters of 2 arrays).
This is what I came up with (removed all typedefs):
Note that the reference connected to the 'controls' property node refers to the "graphs" cluster inside "cluster".
What an interesting way of grouping data... I would have opted for a cluster of [string and array of graphs].
What you use is a cluster of 2 elements:
- string
- cluster of 32 elements:
- cluster of array of cluster of 2 arrays
07-30-2013 09:59 AM
Thanks, I'll have ot study this! I inhereted this code. I would also have preferred an array of graphs, and tried that, but couldn't get it to work.
07-30-2013 10:28 AM
You can not write 2-D anything to an XY plot. In what you showed, you were writing a 2D array of clusters to the XY graph. That being said, I think what you meant is a 1D array of clusters containing 2 arrays (an X and Y). I think Pianne may have hit on your problem. I saw this as a problem of trying to fit the data into the XY graph, but what you are saying is that the problem is in the cluster value (the XY graph should adapt to the input). This is a cluster type definition issue so I now defer to Pianne ;).