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 for Programming
 Forum for Origin C
 Error bars

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
symcel Posted - 02/19/2007 : 05:41:30 AM
Origin Version (Select Help-->About Origin): 7.5
Operating System: XP

I'd like to create 48 error bars with names A1, B1, ... F8

Now I have a worksheet with columns A1 ... F8 and I have written a C function that calculates the mean value of all rows for each column. I have also calculated the standard error for each column.

So could you give me some hints what I should do to create 48 column showing the mean value and the standard error I already have calculated?

Thanks!
5   L A T E S T    R E P L I E S    (Newest First)
symcel Posted - 02/19/2007 : 10:45:49 AM
Thanks Mike,

AddPlot solved my problems (I actually wanted to use the second layer).

Mike Buess Posted - 02/19/2007 : 10:28:27 AM
Try this...

Worksheet wks("Data2");
if( !wks ) return;
GraphPage gp("Graph1");
if( !gp ) return;
GraphLayer gl = gp.Layers(0); // layer 1!!
Curve cc(wks,0,1);
gl.AddPlot(cc); // plot Y
Column cerr(wks,2);
gl.AddErrBar(cc,cerr); // add error bars
gl.Rescale();

Mike Buess
Origin WebRing Member
symcel Posted - 02/19/2007 : 08:59:57 AM
Hmm, my table looks something like this now:

A1 2,86009 2,54687
B1 -1,9127 0,85824
C1 3,35497 2,88728
D1 6,14112 4,76
.
.
.
F8 5,3623 2.525

What I want to do now is to create a graph with 48 columns. I can do this from Origin like this:
1. Select column 1 whith my mean values
2. Plot->Column (which creates the columns A1 to F8)
3. Graph->Add Error bars (which should use the standard error in column 3 in my workspace)

But I haven't been able to figure out how to do this in Origin C. Have tried this code:

GraphPage gp = Project.GraphPages("Graph1");
if(gp)
{
GraphLayer lay = gp.Layers(1);

if (lay)
{
Curve cc(*pErrWsp, 0, 1);
Column colErrBar(*pErrWsp, 2);
int nPlotIndex = lay.AddErrBar(cc, colErrBar);
lay.Rescale();

out_int("nPlotIndex = ", nPlotIndex);
}
}

In the debugger I can see that the cc object doesn't seem to like strings (A1 to F8) in the first column. But even if I try to use the numbers 1 to 48 in stead it doesn't seem to create the columns, just error bars.
Mike Buess Posted - 02/19/2007 : 08:18:27 AM
If you're asking how to set the third column as yEr use this...

Worksheet wks = Project.ActiveLayer(); // active wks
wks.Columns(2).SetType(OKDATAOBJ_DESIGNATION_ERROR);

Mike Buess
Origin WebRing Member
symcel Posted - 02/19/2007 : 08:05:19 AM
I now have a workspace with three columns
No 1 contains the column names (A1...F8)
No 2 the mean values
No 3 the standard error

Just need to igure out how to create the column bars now...

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