Author |
Topic |
|
maxim560
6 Posts |
Posted - 12/03/2013 : 08:55:08 AM
|
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
|
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 |
|
|
maxim560
6 Posts |
Posted - 12/03/2013 : 2:30:08 PM
|
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. |
|
|
lkb0221
China
497 Posts |
Posted - 12/03/2013 : 3:35:57 PM
|
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 |
|
|
maxim560
6 Posts |
Posted - 12/03/2013 : 4:06:24 PM
|
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! |
|
|
lkb0221
China
497 Posts |
Posted - 12/03/2013 : 4:17:42 PM
|
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 |
|
|
maxim560
6 Posts |
Posted - 12/03/2013 : 5:21:35 PM
|
That works. Thanks a lot! |
|
|
maxim560
6 Posts |
Posted - 12/18/2013 : 11:30:04 AM
|
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! |
|
|
lkb0221
China
497 Posts |
Posted - 12/18/2013 : 11:46:20 AM
|
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 |
|
|
maxim560
6 Posts |
Posted - 03/03/2014 : 3:06:07 PM
|
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$; } |
|
|
|
Topic |
|