The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 plotting and averaging with Origin-c

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
tonyv Posted - 05/07/2007 : 06:49:49 AM
Origin Version (Select Help-->About Origin): 7.5
Operating System: Windows Vista

Hi,

I have difficulty to find a Origin-c function which plots several "y" columns (the same x) in one plot and a Origin-c function which averages them.

Thank you for any help!

Tony

1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 05/07/2007 : 09:01:22 AM
Hi Tony,

GraphLayer::AddPlot will add one column or the entire worksheet to a graph layer. See the examples for usage. The following function will average all Y columns in the active worksheet...
void average_all_Y_columns()
{
Worksheet wks = Project.ActiveLayer();
int nCols,iCol = wks.AddCol();
Dataset dsX(wks,0);
Dataset dsY(wks,iCol);
dsY.SetSize(dsX.GetSize());
dsY = 0;
for(int i=0;i<iCol;i++)
{
if( OKDATAOBJ_DESIGNATION_Y == wks.Columns(i).GetType() )
{
Dataset ds(wks,i);
dsY += ds;
nCols++;
}
}
dsY /= nCols;
}


Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000