Author |
Topic |
|
leftsara
3 Posts |
Posted - 05/26/2010 : 06:23:13 AM
|
I use a script to import multiple files at once in the Origin, and make a graph for each set of columns (B,G) of each file imported. But I needed to do only one graph which contains all curves (B,G) of all the files I imported in order to compare them. Does anyone know what I have to add in my script? Thanks Sara
Script:
getfile -m *.lvm; for(i=1;i<=count;i+=1) { getfile -g i; win -t data; open -w %A; sum = 0; loop(ii, 59900, 60000) { sum += Col(C)[ii]; } media = sum/100; wo -a 2; Col(G) = ((Col(C)-media)/media)*100; Col(H) = media/Col(C); plotxy iy:=(2,7); } |
|
VincentLiu
China
Posts |
|
leftsara
3 Posts |
Posted - 05/27/2010 : 11:43:28 AM
|
Thanks for the help, now I can get a graph with the curve of each file, but I'm still having trouble with the axes of the graph. Even using the function layarrange, I can't get the axes of the graph with only one common scale for all curves. Do you know how to do that? |
|
|
VincentLiu
China
Posts |
Posted - 05/27/2010 : 11:51:47 PM
|
By using the Win -m command, it would create a graph with mutiple layers and all the layers would have their own axes. So it may be a little difficult to let all layers share the same scales. But you may modify your scripts as I did in the post below, which will add all plots in the same layer. So all plots will share the same scales.
Script:
win -t p; //create an empty graph %B=page.name$; //Get its name win -h; //Hide it
getfile -m *.lvm; for(i=1;i<=count;i+=1) { getfile -g i; win -t data; open -w %A; sum = 0; loop(ii, 59900, 60000) { sum += Col(C)[ii]; } media = sum/100; wo -a 2; Col(G) = ((Col(C)-media)/media)*100; Col(H) = media/Col(C);
plotxy iy:=(2,7) o:=[%B]1!; //Add all plots in the same layer of the same graph }
Vincent OriginLab Technical Services |
Edited by - VincentLiu on 05/28/2010 03:02:10 AM |
|
|
leftsara
3 Posts |
Posted - 05/28/2010 : 05:16:51 AM
|
Thank you Vincent, you greatly simplify my daily work. Sara |
|
|
|
Topic |
|
|
|