LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save and compare graphs

I want to plot a graph. then save it. then make another plot (in differnt colour) and then compare these two plots byu plotting them on one single graph.Both have same X axis. So X axis will be same and for one Y axis will be on left and for 2nd one it will be on right. My problem is :

1. How can I save the graph?
2. How can I make one's Y axis on left and one's on right.
3. How to merge them on one single plot.

Any help will be greatly appreciated...

thanks
0 Kudos
Message 1 of 3
(4,019 Views)
Hi,

1. You can save the graph in file by using the vi in LV function pallete -> Waveform -> Waveform file I/o -> Write waveforms to File vi. Then you can plot second graph. For comparison, read the previous graph from the file & compare it with the second one.

Alternately you can save your first graph in temporary memory i.e. in array with time-stamping etc. & later on you can compare it.

2. What do mean by left & right y axis ? Pl. clarify.

3. For merging two graph on the single plot, you can bundle both the waveforms.

Also for waveform operations, there are many vi in Labview function pallete -> Waveform - waveform operations.

Hope it helps. Your feedbacks are welcome.

Best Regards,
Nirmal Sharma
India
0 Kudos
Message 2 of 3
(4,019 Views)
1. You can save the graph data by writing the array(s) to a file. There's tens of different ways to do that, one of the simplest is to use e.g. the read and write to spreadsheet VIs and wire the array(s) to the in and outputs of those when you write/read them.
If however you are always working in the developer environment (not a built application) then you can either manually or programmatically set the graph indicators default value whenever you have the graphs displayed that you want. Manually you do this by right-clicking on the graph and then select Make current value default from the data operations menu. If you create a property node you'll find a similar choice there. Search here for more information on storing control values, there's plenty of good examples and instructions on different methods.

3. To get two curves on the same graph then the method if you have the data as separate arrays is to build a 2D array of them and then wire that to the graph indicator.

2. To get two or more Y axis just right-click on the current Y axis and select duplicate from the menu that pops up. If you want the second one to be on the other side of the graph right-click on it and select swap sides. Name the axis by using the text tool and select the axis label. If you search for graph in the find example menu (help) you can find lots of examples on how multiple plots are drawn on the same graph.

Now to set which Y axis the different plots are on click on the plots in the graph legend (right click on the graph and show it if it's not already shown, exapand it to show more than the first plot by scaling it just as one would drag an image bigger in other software...). Click on the plot you want to set in the legend and on the bottom of the menu that pops up you have two options called X scale and Y scale. Go to the sub-menu of the Y scale option and you'll find the two axis you just created and named, select the one you want to use for that plot, now repeat the operation by clicking on the graph legend of the second plot...

All this can off course also be done by code; if you create a property node for the graph you can set the active plot and then all the properties of that plot.

If you get any trouble while exploring the things just described, let me know and I'll give more details and/or code examples.

Merry Xmas:-)
Message 3 of 3
(4,019 Views)