06-08-2017 01:52 PM
I can create multiple plots if I do it all at once by using an array of clusters.
However, I want to create a second plot *after* the first plot is created and plotted. I cant seem to get this to work correctly.
On a side note... how do you make the images that you can drag from here onto a block diagram?
Solved! Go to Solution.
06-08-2017 03:54 PM
WayneS1324 wrote:
On a side note... how do you make the images that you can drag from here onto a block diagram?
Edit -> Create Snippet.
06-08-2017 03:55 PM
Hi there,
You seem to have a pretty good understanding of XY plots, and you've stumbled upon one of the drawbacks - that you have to keep all graph data in memory. You have done it correctly so that the final graph takes in an array of clusters (clusters that contain an array of Xdata and array of Ydata), I'll call that a graph cluster. If you want to add a second plot on, you have to keep your first graph cluster handy, then build into an array with your second graph cluster.
This shouldn't be too hard, the trickier part is when you are updating your plots with a couple points at a time, you have to do a bunch of in place indexing and bundling to get the point added to the plot.
06-08-2017 04:42 PM - edited 06-08-2017 04:47 PM
You have to save your plot history in shift registers with XY charts.
This example plots a power supply output voltage and efficiency from no load to full load for three different input voltages, making 6 total plots in three consecutive runs.
The shift register on the For-Loop saves each Volts and Efficiency pair of plots so the next run pairs are plotted on the same graph.
06-09-2017 12:14 AM - edited 06-09-2017 12:14 AM
Repeating operations (e.g. adding a plot) should be done in a loop. Just built the array of plots in a shift register. Here is a very simple example that demonstrates the technique. (here we add three plots 1 second apart, each incremented by a constant)
Of course in your case the x-values are spaced equally. If this is always the case, you can use a plain waveform-graph and simply define x0 and dx for the x-axis. This makes the data structures singificantly simpler. No need for an xy graph.
06-09-2017 06:56 AM
Thanks for all of the answers. I think gregoryj answered my question.