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
 X-Function Graph Preview with two Y axis.

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
Alex-qwerty Posted - 05/02/2010 : 09:49:06 AM
Origin 8.0 SR6 Operating System: WinXP SP2
I want to create an X-Function with Graph Preview. My function has some vectors as input and two vectors as outputs. I wont to plot output vectors at preview graph one as Y1 (at left axis) and the second as Y2 (at right axis). The bottom X-axis is the input vector.
Can anybody give me an example of such preview?
Or may be there is an system X-Function with such preview graph?
Thanks.
1   L A T E S T    R E P L I E S    (Newest First)
eparent Posted - 05/03/2010 : 4:53:10 PM
Hello,

In your X-Function's GetNGraphPreview_OnInitGraph function add the following to setup your preview graph with two layers and a left and right Y axis.

GraphPage gpPreview = pgTemp;
gpPreview.LoadTemplate("doubley");


In your X-Function's GetNGraphPreview_OnChange function add the following to add plots to your preview graph.

GraphPage gpPreview = pgTemp;
GraphLayer gl;

DataRange dr1;
dr1.Add("X", trGetN.x1.strVal);
dr1.Add("Y", trGetN.y1.strVal);
gl = gpPreview.Layers(0);
gl.AddPlot(dr1, IDM_PLOT_LINE);
gl.Rescale();

DataRange dr2;
dr2.Add("X", trGetN.x1.strVal);
dr2.Add("Y", trGetN.y2.strVal);
gl = gpPreview.Layers(1);
gl.AddPlot(dr2, IDM_PLOT_LINE);
gl.Rescale();

gpPreview.SetShow();


The trGetN argument holds all your variables. In my example I named the X input vector as x1 and the two Y output vectors as y1 and y2.

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