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
 Plot XYXY in one graph

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
kanderlee Posted - 10/02/2007 : 03:53:15 AM
Origin Version : 7.5 sp4
Operating System: XP

I have a worksheet with "XYXY" columns, and I want to plot two independent curves in one graphpage using the template "Vertical 2 Pannel". (The function in Origin is Plot -> Panel -> Vertical 2 Pannel)

void Plot_2_Vert_Pannel()
{

Worksheet wks = Project.ActiveLayer();
if( !wks )
{
out_str("Active layer is not a worksheet!");
return;
}

Dataset dsX(wks, 0);
Dataset dsY(wks, 1);
Dataset dsX2(wks, 2);
Dataset dsY2(wks, 3);

GraphPage gpg;
gpg.Create("PAN2VERT.OTP");

GraphLayer gly = gpg.Layers(0);

Curve crv(dsX, dsY);
gly.AddPlot(crv, IDM_PLOT_LINE);

GraphLayer gly2 = gpg.Layers(1);

Curve crv2(dsX2, dsY2);
gly2.AddPlot(crv2, IDM_PLOT_LINE);
}

This program can show the template correctly, but there is no any curve on the graphpage!
Could someone tell me what happened of my code? Thanks.

Edited by - kanderlee on 10/02/2007 04:17:25 AM
2   L A T E S T    R E P L I E S    (Newest First)
kanderlee Posted - 10/02/2007 : 11:12:43 PM
Thank you, Mike.

As your suggestion, My code can work properly now!
Mike Buess Posted - 10/02/2007 : 09:48:44 AM
Your code works fine if you create the curves with crv(wks,0,1) or crv(dsX.GetName(),dsY.GetName()). Operations on a curve object created from two dataset objects, crv(dsX,dsY), do not affect those datasets which might have something to do with the fact that you can't plot your curves.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 10/02/2007 10:06:03 AM

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