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
 Merging Graphs using LabTalk
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

strcmp23

Bahamas
4 Posts

Posted - 12/28/2017 :  07:10:33 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 2016 (32 bit) b9.3.226 (Academic)
Operating System: Windows 7

I am trying to merge two graphs using LabTalk. I want to label the panels as (a) and (b), with the brackets enclosing the letters.The command I used was

merge_graph option:=specified graphs:="RelModeCav
RelModeObs" row:=1 col:=2 aspectratio:=1 linkarrange:=1 xgap:=6 width:=11.41 height:=7.973 unit:=inch labeltext:=custom labelcustom:=(%(v$)) labelposition:=tli;

However, I received an error message saying that the string v is undefined. I am wondering what I should do. The enumeration codes given on the following page for letters do not seem to work:

https://www.originlab.com/doc/X-Function/ref/merge_graph

cpyang

USA
1406 Posts

Posted - 12/30/2017 :  9:26:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You were using it in your code

labelcustom:=(%(v$))


So you must have string variable v defined before the call?

CP
Go to Top of Page

strcmp23

Bahamas
4 Posts

Posted - 12/30/2017 :  10:00:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
What I am trying to do is to automate the labelling of each graph unit upon merging two or more graph windows. If I use the following command,

//1 by 2 graph
merge_graph option:=specified graphs:="RelModeCav
RelModeObs" row:=1 col:=2 aspectratio:=1 linkarrange:=1 xgap:=6 width:=11.41 height:=7.973 unit:=inch labeltext:=custom labelcustom:=(#) labelposition:=tli;

the panels are automatically labelled as (1), (2),(3) etc. However, I want them labelled as (a),(b),(c) etc. I am wondering what should be the argument to labelcustom to label each panel with lowercase letters.
Go to Top of Page

yuki_wu

896 Posts

Posted - 01/02/2018 :  01:04:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You could try
labelcustom:=<[<%(v$)>]>

The substitution notation %(v$) should be surrounded by a pair of "<[<", so that it won't be parsed before the execution. More examples of string variables can be found on this page:
http://wikis/ltwiki/index.php?title=LabTalk%3AData_Types_and_Variables#String_Variables

Regards,
Yuki
OriginLab

Edited by - yuki_wu on 01/02/2018 01:22:08 AM
Go to Top of Page

strcmp23

Bahamas
4 Posts

Posted - 01/02/2018 :  07:32:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Yuki,

Thanks for the reply. When I use labelcustom:=<[<%(v$)>]>, the panels are labelled as a,b, etc but the brackets are missing. What I want is (a), (b) etc. I tried clicking on the link in your post but it doesn't seem to work.
Go to Top of Page

YimingChen

1653 Posts

Posted - 01/02/2018 :  3:53:52 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Please see if
labelcustom:=<[<(%(v$))>]>
works. Please also refer to this webpage:
https://www.originlab.com/doc/LabTalk/guide/Data-Types-and-vars#String_Variables

Yiming

Edited by - YimingChen on 01/02/2018 3:57:08 PM
Go to Top of Page

strcmp23

Bahamas
4 Posts

Posted - 01/02/2018 :  9:50:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Yiming and Yuki,

Thanks for your help. The code produces the desired result now.

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