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
 Origin Forum
 Formatting metadata on legend translation

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
eskelip2 Posted - 05/14/2024 : 06:47:12 AM
Origin Ver. OriginPro 2024
Operating System: W10

Hello all, I could not for the life of me to get this to work, altough I am sure it is simple and I am just missing something.

I am not very familiar with programming so I am mostly relying on built-functions instead of LabTalk to create my graphs, etcs.

My problem is the following:
I have line plot with a legend where I am accessing metadata. I am using "legendupdate" with "custom" such that the Legend Custom Format ==> @LD"Metadata of relevance"

Hence my legend will get translated to

Symbol, %(1)
Symbol, %(2)
Symbol, %(3)
... etc... and the %(n) gets correctly translated to that metadata of relevance.

The metadata itself in my example are actually powers of ten (so 10, 100, 1000... etc.), and what I want to achieve is to actually get them formatted to the scientific format. so 10^1, 10^2, 10^3, etc.


After the translation that can be by simply using the substitution notation, i.e.: Symbol, $(%(1), P*n), but that would mean I have to add the substitution manually to each translation... Is there a way of getting that to work in Legend Custom Format field?



If I add in the Legend Custom Format field: $(@"Metadata of relevance", P*n) it will translated the substitution functions as text. So in legend it would look like:
Symbol, $(10, P*n)
Symbol, $(100, P*n)
Symbol, $(1000, P*n)
etc...



I would prefer not to have to use a LabTalk script which is executed after translation since I really don't know how to implement those properly, but if that is the only way I would be happy to get some pointers on how to get it done.

Patrik Eskelinen, an Engineer in Science
5   L A T E S T    R E P L I E S    (Newest First)
eskelip2 Posted - 05/15/2024 : 02:34:17 AM
Hi Nicholas, it was only a couple minutes of difference , thanks for adding in that ticket.

Hello Cecilia, that is very neat, I knew I was indeed missing something simple to get the substitution to work. I actually tried changing the level at some point if I recall, but I went further back instead of going forward. In my head I interpreted the logic of that in reverse.

Very nice to have a double solution here. Have a wonderful day.


Patrik Eskelinen, an Engineer in Science
Cecilia_syy Posted - 05/14/2024 : 10:45:37 PM
Hi Patrik,
your original solution ($(@LD"Metadata of relevance", P*n)) could also work, just need to open legend properties dialog, go to Programming tab, set Link to (%, $), Substitution Level to 2.

Cecilia
NicholasSupport Posted - 05/14/2024 : 2:27:15 PM
quote:
Originally posted by eskelip2
Everyone, have a wonderful time.

Patrik Eskelinen, an Engineer in Science



Patrik,

Just saw that you beat me to it. Great work! No need to feel silly.

In fact, I am checking with the developers to see if we can improve the legendupdate dialog to support customizing numeric displays in a more direct manner.

For reference, this suggestion is filed under Jira ORG-29144.

Cheers,

Nicholas G.
nicholas@originlab.com
OriginLab Technical Support Team
NicholasSupport Posted - 05/14/2024 : 12:03:39 PM
Hello Patrik,

Currently, the best solution is as follows:

1. Navigate to your worksheet and right-click on the header of a metadata row (such as Long Name) and select "Insert > User Parameters..." from the context menu. On the dialog that appears, name the new parameter "Legend" and click OK

2. Select the new row of metadata and right click on one of the highlighted cells. In the context menu, select "Set User-Defined Styles > More..."

3. Check the box next to RICH TEXT
Change DISPLAY to "Scientific:10^3"
Click OK

4. In the new row, enter the powers of ten, e.g. 10, 100, 1000, 10000, etc

5. Navigate to your graph and open the legendupdate dialog. In the LEGEND CUSTOM FORMAT field, use the fly-out menu to select @LD"Legend", or just type it in, then click OK

Your legend should now automatically switch to scientific notation when display the 'Legend' metadata.

Please let me know if you have any further questions.

Best,

Nicholas G.
nicholas@originlab.com
OriginLab Technical Support Team
eskelip2 Posted - 05/14/2024 : 12:02:16 PM
Well, I feel quite silly right now. I didn't realize that metadata/labels could be bulk formatted in Workbook itself, which fully solves the problem. If anyone else is having same issue, and for posteriority. Here is the drop down menu, under "More..."


I also didn't realize that the formatting style when applying this change is different from the other notations.


Everyone, have a wonderful time.

Patrik Eskelinen, an Engineer in Science

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