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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Problems with 3D-Surface
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

glider27

1 Posts

Posted - 03/18/2012 :  11:07:50 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello together,

i have problems to set my data to an 3D-Surface-Graphing.

My data are in this form, that i have variable x-datas for my z-datas, while my y-datas are also variable. In pictur i have a sample like my datas are formatted:

How can i get a 3D-surface with this changing values ??

Thanks for help



Hideo Fujii

USA
1582 Posts

Posted - 03/19/2012 :  11:25:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi glider27,

You first need to convert your formatted worksheet to a 
3-column XYZ worksheet, then need to convert it to a matrix. 
From a matrix, you can make a 3D surface plot. The following 
is a possible procedure:

1) Run the following script to get an XYZ worksheet: 
///////////////////////////////////////
  Bk1$=%H;  //current wks
  newbook;  //make a new wkbook
  Bk2$=%H;  //output wks
  wks.addCol();  //add a col
  wks.col3.type=6; //set as Z
  nc1=bk1$!wks.nCols/2; //col pairs
  nr1=bk1$!wks.maxRows; //rows
  ii2=0;
  for(jj=1; jj<=nc1; jj++) {  //loop for cols
    range B1x=[Bk1$]!wcol(2*(jj-1)+1);
    range B1yz=[Bk1$]!wcol(2*(jj-1)+2);
    for(ii=2; ii<=nr1; ii++) {  //loop for rows
      xx=B1x[ii];  //current x
      yy=B1yz[1];  //current y
      zz=B1yz[ii];  //current z
      range B2x=[Bk2$]!1;
      range B2y=[Bk2$]!2;
      range B2z=[Bk2$]!3;
      ii2++;
      B2x[ii2]=xx;
      B2y[ii2]=yy;
      B2z[ii2]=zz;
    }
  }
  type -b %(Bk2$) with $(ii2) rows has been created;
///////////////////////////////////////



2) Convert the XYZ worksheet to a matrix by gridding by 
  "Worksheet: Convert to Matrix: XYZ Gridding" menu.
  (You should find the best-suited gridding algorithm such as 
   "Random (Thin Plate Spline) and its parameters by some experiments)
3) Once you obtain a matrix, you can make a 3D Surface plot by e.g.,
  "Plot: 3D Surface: Color Map Surface" menu.

Hope this is helpful for you.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 03/19/2012 11:30:18 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000