Hi,
So you basically want to smooth all curves plotted in a graph layer and get a result worksheet with the smoothed data - and you want to do this without having to select one curve at a time using the GUI...
Try the script pasted below. Make your graph active, copy-paste all lines of script into script window, then higlight and select all the pasted lines and press Enter key.
If this is what you want, you could tweak the script to make changes and then you can look up programming help on how to put the script into an OGS file and run it, or make a button and have the script run from a new button etc.
Hope this helps.
Easwar
OriginLab
// Make graph with raw data curves active and
// then run this script
//
%a=%h; // save graph name
create.wksName$="Smooth"; // create result wks
create.wksLabel$=Smooth Results for %a;
create.template$="Origin";
create.wks(junk);
%b=create.wksname$;
win -o %b // delete cols in result wks
{
del col(1);
page.title=3;
};
layer -c; // count number of data plots in layer
for(i=1; i<=count; i++) // loop over plots
{
%a=%(i,@d); // get name of dataset of plot
ix = i * 2 - 1; // ix is index for x result column
iy = ix + 1; // iy is index for y result column
win -o %b // run script on result worskhet...
{
wks.addcol(X); // add x, y columns
wks.addcol(Y);
wks.col$(ix).type=4; // set y column label using dataplot name
wks.col$(iy).label$ = Smoothed
%a;
};
%(%b,ix)=xof(%a); // Set result x same as raw data x
curve.data$=%a; // Use curve object to smooth
curve.SmoothPts=10; // Change number of points for averaging here...
curve.result$=%(%b,iy);
curve.adjave(); // Use adacent averaging
layer.include(%(%b,iy),200); // Plot smoothed result
set %(%b,iy) -c 2; // Set smoothed result curve color to red
win -o %b {wks.labels();}; // Show labels on columns in result wks
};