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
 adding matrix data to a 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
Voostra Posted - 03/21/2005 : 8:32:13 PM
Origin Version (Select Help-->About Origin):
Operating System:

So, I had some data in a worksheet, created a new matrix, then did some transformations on the worksheet before moving the data into the matrix (a matrix page in the project. and a Matrix matA)

The short of the problem is - I have been able to generate a graph page using a template for for the kind of 3d plot I want, and have added a graphlayer gly, I defined a matix object based on the matrixlayer where I though the data was, then tried to :

gly.AddPlot(matrixlayer)

But, it doesn't do anything. I get the graph window opened up, and a blank 3-d plot, but no data.

I'm hoping there is an easy way to add matrix data to 3-d plot graphlayer?

(On another note, is there an easy way to switch which layer is the active layer - i.e. if I have a worksheet, a matrix and a graph page in a project, is there an easy way to make one of them active? , also, is there an easy way to change the name of an active layer?)

Pretty new at this... thank for the help,
Evan

(sorry if this is a double post, first one didn't seem to go through)
3   L A T E S T    R E P L I E S    (Newest First)
Voostra Posted - 03/22/2005 : 1:08:12 PM
okay, scratch that - they're listed in the graph.h header file.
Voostra Posted - 03/22/2005 : 12:44:29 PM
Is there a list of the "IDM_PLOT_SURFACE_COLORMAP" definitions anywhere - I want to use some other types, but can't find a list to know what I need to plug in here.

Thanks,
Evan
edsger Posted - 03/22/2005 : 08:20:40 AM
well I was not sure if you meant a surface plot. but if that is what you mean then you might try this. Note that the values should be evenly spread between the X and Y axis
 
// worksheet with the data
Worksheet wks("surface");

// create matrixpage to accomodate the data
MatrixPage mp("matrix1");
mp.Create("origin");
MatrixLayer mly = mp.Layers(0);
Matrix matA(mly);

// copy data to matrix
matA.CopyFromWks(wks);

// define X axis values and Y axis values for surface
matA.Xmin = -10;
matA.Xmax = 10;
matA.Ymin = 0;
matA.Ymax =100;

MatrixObject mobj = mly.MatrixObjects();

// create graph
GraphPage gp;
gp.Create("Wirefrm");// important!!

GraphLayer glay = gp.Layers();
// plot surface and indicate that it should be a
// IDM_PLOT_SURFACE_COLORMAP for colormap
// or IDM_PLOT_SURFACE_WIREFRAME for WIREFRAME
//
int nPlot = glay.AddPlot(mobj, IDM_PLOT_SURFACE_COLORMAP);
glay.Rescale();


unfortunately this is not documented well
(or at least I didn't find it yet but with a little common sense and some post from the forum I got the colormap to work)


Edited by - edsger on 03/24/2005 3:22:21 PM

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