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
 LabTalk Forum
 How to express in custom field of legendupdate?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hkkim

Republic of Korea
35 Posts

Posted - 12/27/2012 :  01:14:47 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8.1 SR3
Operating System: Windows XP

Hello!
I want to display a graph symbol, an absolute path and a comments field as a graph legend. Here is my command. But the only longname was displayed as a result. How can I fix it?
Thanks in advance!

legendupdate update:=0 legend:=0 mode:=7 custom:="\l(1) %(1, @R) %(1X, @LC)";

hkkim

JacquelineHe

287 Posts

Posted - 12/28/2012 :  01:30:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Our last version Origin 90 supports your labtalk script, but Origin 8.1 does not.

You can try to use this script to instead it:
label -sl -n legend "\l(1) %(1, @R) %(1X, @LC)";

If you want to know more info about that, please refer to these pages:
http://www.originlab.com/www/helponline/Origin/en/Programming/mergedProjects/LabTalk/Script/Creating_and_Accessing_Graphical_Objects.html#Creating_Legends

http://www.originlab.com/www/helponline/Origin/en/Programming/mergedProjects/LabTalk/LabTalk/Label_(command).html

Thanks

OriginLab
Jacqueline

Edited by - JacquelineHe on 12/28/2012 01:34:33 AM
Go to Top of Page

hkkim

Republic of Korea
35 Posts

Posted - 01/04/2013 :  01:31:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Jacqueline,

I want to display comment fields up to 4 on a graph. The GObject was used to reduce a font size. Below is a part of my code. But the only last label is showed. How could I fix this problem? Thanks in advance!!

-------------------------------------------------------------------------------------------------
int commentY=800; // commentY has the 1st comment Y pixel location on a graph
...
loop (i1, 2, graphno) // loop column from 2nd to end
{
...
plotxy [%(rPage.name$)]1!(1,$(i1)) plot:=202 ogl:=[<new template:=%(tmpPathName$)>];
// draw new graph with 1st worksheet
GObject cmt1=label;
label -s -d 3800 commentY -n cmt1 "%(@LC)";
// 1st column comment display on a graph
cmt1.fsize=16;
...
loop (i2, 2, compno) // loop worksheet from 2nd to end
{
plotxy [%(rPage.name$)]($(i2))!(1,$(i1)) plot:=202 ogl:=1;
// add a graph line using from 2nd to end layers
commentY=commentY+i2*100;
// commentY has the 2nd~4th Y pixel location on a graph
GObject cmt2=label;
label -s -d 3800 commentY -n cmt2 "%(i2, @LC)";
cmt2.fsize=16;
...
}
...
}

Edited by - hkkim on 01/04/2013 01:33:22 AM
Go to Top of Page

Kathy_Wang

China
159 Posts

Posted - 01/06/2013 :  01:02:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

So far as I can see from the parts of your script, in every loop the previously generated label will be replaced by the new label, as you used "label -n" option which replaces the specified label.

So in case you want to show 4 labels, you need to create 4 labels, for example when you define GObject cmt2, instead of attach it to "Label" which is the same label cmt1 attached to, attach it to a new label object "Label1" by:


GObject cmt2 = Label1;


Kathy
Originlab
Go to Top of Page

hkkim

Republic of Korea
35 Posts

Posted - 01/06/2013 :  8:39:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Kathy,

Thank you for your comment.
I'm still not familiar with OOP.
My code runs well now. Thanks again!

hkkim
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