| 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... |
|
|