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
 Merging (x/y) worksheets to create 3d plot

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
ipc2uka Posted - 10/17/2005 : 1:12:55 PM
Origin Version (Select Help-->About Origin): 7 SR 4
Operating System: XP

I have some 10 worksheets with same x value ranges and different y values each.
To every data set, there corresponds a different parameter m.

In order to create a 3d contour plot (y vs. x/m) I need to create a matrix. The easiest way to get it is to have all the data in one worksheet of the following format, I assume:

col1(X) col2(Y) col3(Z)
----------------------------
1 m1 z(1,m1)
2 m1 z(2,m1)
3 m1 z(3,m1)
1 m2 z(1,m2)
2 m2 z(2,m2)
3 m2 z(3,m2)
1 m3 z(1,m3)
2 m3 z(2,m3)
3 m3 z(3,m3)


Then the worksheet can be converted by "ConvertToMatrix/RandomXYZ".

I have the following question:

  • Is there some program/macro/.. to merge the worksheets? I assume there is already several people who have encountered the same problem...

  • Do I run into trouble managing the amount of data (x=1..2000 and m values are not regularly spaced (1,2,3,10,100,1000), so there have a lot of columns to be created in order not to loose information

  • ..or is there a much more easy way to get the 3d graphs


Thank you for your help


1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 10/17/2005 : 4:30:22 PM
It's easy to stack any number of worksheets to form your X and Z columns with a LabTalk or OriginC script. You only need to supply the wks names. The tricky part is supplying the corresponding Y values (m1, m2, ...). The following LT script uses a list (%L) of worksheet names and a vector (yy) composed of the m values. There might be more efficient methods depending on how you've named your worksheets but this is probably a good place to start.

%L=Data1 Data2 Data3 Data4 Data5 Data6;
yy={1, 2, 3, 10, 100, 1000};
win -t D; // create a new wks
%W=%H; // save its name
wks.addcol(C); // add a column
wks.col3.type=6; // make it a Z column
%A=%[%L,#1]; // name of first wks
tmp=data(1,%A!wks.maxrows); // temporary dataset
for(i=1;i>0;i++) {
%A=%[%L,#i]; // ith wks
if(%A=="") break;
tmp=yy[i];
copy -a %(%A,1) %(%W,1);
copy -a tmp %(%W,2);
copy -a %(%A,2) %(%W,3);
};
del tmp;
del yy;

Mike Buess
Origin WebRing Member

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