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
 Origin Forum
 Formatting Substitutions in Legend
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

maxim560

6 Posts

Posted - 12/03/2013 :  08:55:08 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear all,

I would like to format the substituted values in a legend of a graphic.

Currently in the workbook column the comment consists e.g. of text 1.2000000e+2 and parameters0 is 2.0000000e+2. I want the legend to display "120 to 200".

What I did is to write in the graphic in update legend --> custom legend format: @LC to @LP. But this displays the numbers in the 1.2000000e+2 format.

Is there a way to extend the notation in custom legend format to obtain the desired output in the legend? If not what alternatives are the easiest.

Thank you very much,

Maxim

lkb0221

China
497 Posts

Posted - 12/03/2013 :  11:43:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Maxim

I don't think there is a way to do this...

Is there a particular reason that you have to keep so many digits in column label row?

The best way I can come up with is just change your label row value to 120 and 200. Or use another two label rows to contain those things you want to show in the legend.

Zheng
OriginLab
Go to Top of Page

maxim560

6 Posts

Posted - 12/03/2013 :  2:30:08 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I simply want to automize the import and plotting. And it imports in meta data in the scienctific form 1.2000000e+2.

Is there a way to change the format of comments and parameters before/after import.
Go to Top of Page

lkb0221

China
497 Posts

Posted - 12/03/2013 :  3:35:57 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Maxim

I'm afraid there might not be a direct way to implement this. But you can try the following:

1). Use Import Wizard to import your files. (File: Import: Import Wizard)
2). Keep click "Next" to "Save Filters" page. click "Save filter" and "Specify advanced filter options" checkbox.
3). In the next "Advanced Options" page, select "Run script after all files imported" and copy the following script into the edit box.
//Script Start
range r2=2;
string str$=r2[c]$;
str$=str.format(".0")$;
r2[c]$=str$;
//Script End

This will automatically format your imported column header row value to be integer.

Hope this would help.

Zheng
OriginLab
Go to Top of Page

maxim560

6 Posts

Posted - 12/03/2013 :  4:06:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This only transforms the comments of the second column. How can I apply it to comments and parameters of all columns?

Thank you very much!
Go to Top of Page

lkb0221

China
497 Posts

Posted - 12/03/2013 :  4:17:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Oh, sorry
Please try the following:

loop(ii,1,wks.ncols)
{
range rr = col($(ii));
string str$ = rr[c]$;
string str2$ = rr[P1]$;
str$ = str.format(".0")$;
str2$ = str2.format(".0")$;
rr[c]$ = str$;
rr[P1]$ = str2$;
}

This will change both the comment and 1st parameters label row.
Currently there seems to be no way to loop between column headers.

Edited by - lkb0221 on 12/03/2013 4:20:31 PM
Go to Top of Page

maxim560

6 Posts

Posted - 12/03/2013 :  5:21:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That works. Thanks a lot!
Go to Top of Page

maxim560

6 Posts

Posted - 12/18/2013 :  11:30:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
How can I custamize

str$ = str.format(".0")$;

so that it also displays until the first/second digit after the dot?

Thank you very much!
Go to Top of Page

lkb0221

China
497 Posts

Posted - 12/18/2013 :  11:46:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Just by customize those str.format commands.
For example:
str.Format("*3") --> 3 significant figures
str.Format(".2") --> 2 decimal places

Edited by - lkb0221 on 12/18/2013 11:47:13 AM
Go to Top of Page

maxim560

6 Posts

Posted - 03/03/2014 :  3:06:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
How do I have to extend the code so that it works when I import multiple worksheets at the same time?

loop(ii,1,wks.ncols)
{
range rr = col($(ii));
string str$ = rr[c]$;
string str2$ = rr[L]$;
str$ = str.format(".2")$;
str2$ = str2.format(".2")$;
rr[c]$ = str$;
rr[L]$ = str2$;
}
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