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
 axis title

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
ovince Posted - 07/04/2006 : 06:25:10 AM
hi All

I would like to ask for help. The problem is trivial seems to me but I can not find the solution :(


I have about 50 files with nice 'scientific' names like:

LickCN1.dat
LickFe5270.dat
etc.

I wrote a small routine in Origin C which reads in the content of these files and plot an appropriate
plots. What I would like to do is to label Y axis of these plots with the name of the files (LickCN1,
LickFe5270 etc.). The routin is somthing like this (it is short so I will not hesitate to copy-paste it):

void plotting_with_err_bar()
{

PageBase pg;

// Create a Project object
Project proj;

// Loop over all pages in the project and display their names:
foreach (pg in proj.Pages)
{
String name = pg.GetName();


// Declare worksheet, data curve and error dataset and check validity
Worksheet wks(name);
Curve crvData(wks, 0, 1);
Dataset dsErr(wks, 2);


// Create a new graph and plot the data as a scatter plot
GraphPage gpg;
gpg.Create( "Origin.OTP" );
GraphLayer gly = gpg.Layers( 0 );
gly.AddPlot( crvData, IDM_PLOT_SCATTER );


// Add the error dataset as error bar to this plot
int nPlotIndex = gly.AddErrBar( crvData, dsErr );


// Rescale layer
gly.Rescale();


//set X and Y titles
LT_execute("lab -xb (classes);");
LT_set_str("%P", name);
LT_execute("label -yl %P;");

}
}



I have tryed with lots of combinations like:
//"lab -yl $(P);";
//"lab -yl P;";
//"lab -yl $(%P);";
//"lab -yl %P;";
//"lab -yl (P);";
//"lab -yl (%P);";
//"label -yl %P;";
//"lab -yl ($(%P));";

but no success.


Could someone to help me with this?

Thanks
oliver
2   L A T E S T    R E P L I E S    (Newest First)
ovince Posted - 07/06/2006 : 06:04:00 AM

...Thanks Mike

Regards
oliver
Mike Buess Posted - 07/04/2006 : 07:29:07 AM
Your Y-axis label probably ends up as "%P". To label with the contents of %P you need to use the -s switch...

LT_execute("lab -s -yl %P");

Mike Buess
Origin WebRing Member

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