LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple graphs in XYgraph!

Hi guys!
I have a litle problem. I am using a program, to draw several curves in a only one xygraph, I have a while loop, i read from the file (spreadsheet file), each file take 2 curves (4 arrays). I want to open differents files into the graph, but when i draw one file, with i try to open other the graph is cleared and draw only the new file.
This option is for draw differents curves to compare them.
How can I do it for see several curves?.

Thanks, i would be grateful to you...! (if it possible with a example i could to see better)
0 Kudos
Message 1 of 8
(3,704 Views)
Bundle Y array 1 with X array 1 from file 1, Y array 2 from file 1 with X array 2 from file 1, Y array 1 from file 2 with X array 1 from file 2...etc etc...and build an array of all the clusters, wire that array to the XY graph.

Use thew graph legend to assign names and colors to the different curves and to set which X and Y scale they are to use (if you have created multiple axis by double-clicking on an axis and selecting duplicate...).

For an example on the bundling and array building described above select find example from the help menu of LV and search for XY Graph.vi

If you need help in decoding the files to get the arrays please upload a file example.
0 Kudos
Message 2 of 8
(3,704 Views)
Hi thanks for your reply,

But i used bundle and build array to input in the graph, the problem is open other file with other curves. I attachment a example, Can you adjust this vi to enter differents files in this graph?.

thanks.
Download All
0 Kudos
Message 3 of 8
(3,704 Views)
Well, it depends on just how flexible the solution is to be. If you want to be able to change one of the files and just read that new file then you need to keep the data from the other file in e.g. a shift register and rebuild the array. You can have a button or a path control to browse for a new file; if you use the latter it may be nice to check it for changes and do a file load automatically without a need for a button...If you want to compare more than two files you may want to add some logic that will assign newly added fiels a channel number etc...

In the attached example the user is required to specify two files prior to clickig the load button. That's one way to make a two-channel system. I would add logic that would handle cases where one of the
files does not exist etc...

In your example you reduced the 2D array to a 1D array by deleting one and the same row and get the deleted part...use the index array function instead, it will use less memory, and I assume you want different rows. I'm not sure what is the X and what is the Y arrays and the data looked a bit strange to me, but check it out, perhaps you need to rearrange the arrays.
0 Kudos
Message 4 of 8
(3,704 Views)
0 Kudos
Message 5 of 8
(3,704 Views)
Hi mads!

thnx for your time, Its good, but i want to input 8 or 10 files,and only push one bottom to input the first file, then push the bottom and input the second,.... even I can remove any file, it would be great!, but i think i dont belive to be able to do it.;), i can to open only from a only folder.
is it difficult to make it?. If you want to help me, i would like have contact with you by the mail.
write to : josearrow@yahoo.es

Thanks for the index array, i dont know how i must to do it, but it was working..;), i am not a good user of this tool, but i think its very good. The files only was a example, are bad values, dont worry for that!. happy new year... regards
0 Kudos
Message 6 of 8
(3,704 Views)

Hey Guys,

I just have a small problem working with the index array function. I want to know how I can change the index array function to get the new rows in a different file? I'm working on three plots. I want to plot all three of them into one xy graph. Almost like multi-plotting.

Thanks.

0 Kudos
Message 7 of 8
(3,288 Views)

You've posted to an old thread and it's not exactly on subject.

As mentioned earlier, to resize the Index Array function, just look at the on-line help as shown below. When your mouse moves over the grab handle at the bottom of the function, you should see the other image. Just drag it down. Simple. With context help turned on, when you move your mouse over an XY graph, it will tell you exactly how to create a multi-plot.



Message Edited by Dennis Knutson on 06-25-2008 03:22 PM
Download All
0 Kudos
Message 8 of 8
(3,276 Views)