11-01-2008 03:50 AM
Hi - I'm trying to come up with a structure to present my data.
I need a variable number of plots.
Each plot has X-Y coordinates that vary.
The number of XY coordinates per plot varies too.
I need to update the graph regulalry during a process.
I think I need an XY graph. But the problem I have is this:
To get multiple plots, I need to use an array of clusters of coordinate pairs.
But if one plot contains more data than the others, I get a whole bunch of redundant 0,0 coordinates in the other plots. This messes up the appearance of the graph.
How can I get around this? I presume there is some way to have multiple plots with different amounts of data per plot?
See attached VI for an example.
Thanks in advance for any help!
Jon.
11-01-2008 10:05 AM
I would look at the XY graph example.
The data structure you have appears to be equivalent to "Array of Points Multiplot". I noticed that if I changed the array index in one of the arrays, the other 2 changed as well. So the 3 are inherently linked.
I would recommend using the "X and Y arrays Multiplot" and build the data that way.
11-01-2008 09:36 PM
Look at the way you encapsulated your data. There is unuseful zeros in your plots, you only have to dont put it, or remove it depending on your application. Look at the attached VI, ask for any question.
Jimmy
11-02-2008 12:29 PM - edited 11-02-2008 12:36 PM
(Jimmy, the original poster has LabVIEW 7.1, so he will not be able to see your example, wiich is in LabVIEW 8.6.)
The problem is that the inner arrays are padded with zeroes for equal lenght, and this points to faulty coding where you generate the data in the first place. Can you show us how you generate the data? Maybe there is a better way.
Anyway, to clean up the data after the fact, you could just trim the inner arrays to the valid ranges as follows (I start searching at element 1 in order to retain the first point if there is a plot with one point that is [0,0]).
Here's a quick example on how you could do it (autoindex, unbundle, seach 1D array, array subset, bundle, autoindex):