Script to Plots several XY data on the same graphs
darg
After playing with Igor pro, I begin some task:
1) write a script to Load multiple files (containing XY data with headers). Thank to Igor "Data Folder tutorials", it works fine!
2) plots Y vs X for all the loaded files : I have a problem!
In 2) I used the fonction "PlotDataFromSelectedSets(dataFolderList, quantityName)" of "Data Folder tutorials" procedure. However, I am not able to plot each X-Y data with different X wave. The fonction use the same X (the current data folder).
I don't know if this is the best way to do it!
Any comments and suggestions are welcome.
Please find in the attached files:
My experiment and the data files.
Thank you in advance for your comments and helps!
adarg
February 18, 2013 at 07:37 pm - Permalink
Thank you.
Please find the experiment with the procedure.
My work get a small progress.
I can plot different x-y with different x.
Now I am working on with 2 sets of data : simulation x-y data and experiment x-y data.
In the Igor pro experiment experiment data are labelled "xxxxxExp_ReducedDOS_yyy" and simulation data are labelled "xxxxSimRDOS_yyy.
I would like to plot these data on the same graphs in order to compar.
Thank in advance for comments and suggestion
adarg
February 19, 2013 at 03:54 am - Permalink
I do something similar to this and here is how I do it. The code below assumes a single file of the format: X1 Y1 X2 Y2 X3 Y3
Since your data is in multiple files, this will require some tweaking but shouldn't be too difficult.
Load waves from a file (use the LoadWave function). The wave names will be stored in S_Wavenames
variable i
Display
for(i=0; i<itemsinlist(s_wavenames); i+=2)
Wave Xwave = $(Stringfromlist(i, s_wavenames, ";"))
Wave Ywave = $(Stringfromlist(i+1, s_wavenames, ";"))
appendtograph ywave vs xwave
endfor
You now have one graph with all of the waves from your file.
February 19, 2013 at 08:25 am - Permalink
Thank you for your comments.
Finally, I used Igor's "Data folder tutorials" example. It works well!
Your code will help me for other project!
Do you know how delete a noise data. For example mask a range of data.
Thank you.
February 23, 2013 at 05:58 am - Permalink
Could you be more specific? I'm not sure what you mean by this. Do you want to change the values in the data wave?
February 25, 2013 at 03:25 pm - Permalink