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
|