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 for Programming
 Forum for Origin C
 axis title
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ovince

Yugoslavia
Posts

Posted - 07/04/2006 :  06:25:10 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Mike Buess

USA
3037 Posts

Posted - 07/04/2006 :  07:29:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

ovince

Yugoslavia
Posts

Posted - 07/06/2006 :  06:04:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply

...Thanks Mike

Regards
oliver
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