LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting a variable number of curves on different XY Graphs

Is it possible to plot any number of curves on different XY Graphs?

 

In my case, sometimes I need to plot 3 curves, sometimes 4, sometimes 6, etc. Generally, it is between 2 to 6 plots on different XY Graphs.

 

How can I go about doing this? 

 

What I am thinking so far is to have six XY graphs on the front panel, but somehow programmatically activate the first 2, 3, 4, 5 or however many plots I need to make.

I am really at a loss here.

0 Kudos
Message 1 of 6
(2,222 Views)

YIKES! Don't make 6 graphs. Just make one graph, and the graph can take an array of clusters, where each cluster element is an array.

 

For example, cluster element 1 is the x data array, cluster element 2 is the y data array. Then you build an array of these clusters. See below:

 

0 Kudos
Message 2 of 6
(2,211 Views)

Thanks for the reply. But I must have my plots on different XY graphs. That is the whole point 😞

0 Kudos
Message 3 of 6
(2,200 Views)

Hi Murchak,

 

If you really need 6 graphs, but don't necessarily want to use them all the time, you may just want to use the 'Visible' property node and set the graphs not in use to be invisible.  You can see the attached vi for a short example.

 

Cheers, 

Cole R.
National Instruments
Software Engineer
0 Kudos
Message 4 of 6
(2,181 Views)

Sorry, my misunderstanding. Cole's solution is best for what you're trying to do. Although, it can make your front panel look somewhat funny when you have a bunch of blank space because graphs are hidden. Would subpanels be another option, albeit not necessarily any easier or more efficient? I don't know enough about your problem to say yes or no, but that might be another thing you want to look into.

0 Kudos
Message 5 of 6
(2,178 Views)

Thank you Cole and for(imstuck).

 

For my application, I have a file dialog box that opens up when I run my VI, and depending on how many samples have been tested, I plot them.

Sometimes we have 3 samples tested, sometimes 4, sometimes 6, and so on. These samples must be plotted on different XY Graphs.

 

What I have right now is six XY Graphs on the front panel, and if we have only tested 3 samples, I choose the three files, which will be plotted on

the first 3 XY Graphs, and the file dialog pop up opens up again and again and again until I have selected six files. Basically, the last 3 XY Graphs

will be repeat of the first 3.

 

I'll think more about what can be done.

0 Kudos
Message 6 of 6
(2,175 Views)