LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Plots in a single graph

Hi Friends,

 

I have a data file of five coloumns. I know how to get a multiple plot in XY graph with first coloumn in the X axis, and rest of the coloumns in the Y axis. I did it using read spreadsheet file, index array, bundle and finally build array. So I have five plots with the same X value but with different Y value. 

 

Now here is something different I want to do.

 

I save the data from another vi. and that vi has an input parameter (actually the iteration of a while loop) which will decide how many coloumns of data you will be saving in the file. I want to plot the first coloumn in that data file in the X axis and the rest of the coloumns in the Y axis, thus making as many plots as the input parameter.

 

I really appreciate if sombody has any idea how to proceed.

 

Thanks for your kind time.

 

Regards,

 

Medhi.

 

 

0 Kudos
Message 1 of 8
(3,436 Views)
so you are saying you wont know the exact number of columns being read and how do you make your plot go from maybe plotting 2 lines to plotting 10 dependin on the data in teh file correct? I don't have labview on this computer, but im sure someone can put an example, i'm just trying to clarify your question a little. I'm sure someone else will come on here with a response soon, this is a fairly  trivial question. Keep searching the forums i'm sure there is something out there on this situation already. Best of luck.
0 Kudos
Message 2 of 8
(3,426 Views)
Yes you are right. Thanks for the reply. .
0 Kudos
Message 3 of 8
(3,422 Views)

Just delete the first column using "delete from array" and transpose the remaining 2D array. Get the first column from the "deleted portion" output.

 

Now autoindex the 2D array in a FOR loop. Inside the FOR loop, bundle the X (the first column, not autoindexed) with each Y array from the autoindexing terminal and autoindex the cluster at the right edge and feed ot to the XY graph.

 

All clear? 🙂

0 Kudos
Message 4 of 8
(3,421 Views)

There are many different ways to solve this issue.  But first, let me ask you a couple questions.

  1. Are the points evenly spaced on the X-axis? IE, could be described with T0 and deltaT
  2. How big are the data files?
  3. If there is 6 columns in the data file, would there be a reason to display 3 graphs rather than 5?  Or would you always want every column in the file?

Paul
0 Kudos
Message 5 of 8
(3,417 Views)

altenbach wrote:

All clear? 🙂


Here's a quick draft. Modify as needed.

 

Message Edited by altenbach on 11-04-2009 05:48 PM
0 Kudos
Message 6 of 8
(3,415 Views)

Ah, the old LabVIEW proverb. A picture is worth a thousand words...case and point..

Told you someone would help 🙂


altenbach wrote:

Just delete the first column using "delete from array" and transpose the remaining 2D array. Get the first column from the "deleted portion" output.

 

Now autoindex the 2D array in a FOR loop. Inside the FOR loop, bundle the X (the first column, not autoindexed) with each Y array from the autoindexing terminal and autoindex the cluster at the right edge and feed ot to the XY graph.

 

All clear? 🙂


 

Message Edited by for(imstuck) on 11-04-2009 08:31 PM
Message Edited by for(imstuck) on 11-04-2009 08:32 PM
0 Kudos
Message 7 of 8
(3,402 Views)

Perfect.

This is exactly what I want. Smiley Happy

Thanks a ton.

0 Kudos
Message 8 of 8
(3,393 Views)