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
 Fit Page to Layers pfit2l, batch mode?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

dekos

8 Posts

Posted - 08/17/2021 :  08:25:29 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2021b
Operating System: Win10

Hello,
I would like to perform "Fit page to layers" on multiple graphs, all in the same way. How can I do that? The dialog doesn't have this option, but maybe via LabTalk?
pfit2l margin:=tight direction:=height;

How can I perform this command on every graph in my folder?

Thx!

snowli

USA
1386 Posts

Posted - 08/17/2021 :  09:14:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,
U can use document command loop over all graphs in active folder
doc -ef LP
{pfit2l margin:=tight direction:=height;}

See the following pages of how to loop over objects in Origin and document command page for all options.
https://www.originlab.com/doc/LabTalk/guide/Looping-Over-objs#Looping_Over_Graph_Windows
https://www.originlab.com/doc/labtalk/ref/document-cmd#-ef.3B_Execute_the_given_script_for_all_objects_in_the_current_folder

Thanks, Snow
Go to Top of Page

dekos

8 Posts

Posted - 08/17/2021 :  09:58:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Nice, thank you.

But I've noticed one strange thing: If the graph is hidden when performing the command, it gets cropped too much (see below). Luckily, repeating the command when graph is not hidden anymore, gets the desired result.

Go to Top of Page

snowli

USA
1386 Posts

Posted - 08/17/2021 :  10:05:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I make some graph hidden and some not and run the code. No difference.

Does it happen to all hidden graphs or only specific one?
Do you mind letting me know the original dimension of the graph so i can check if hidden or not makes difference?

Or could you save the problematic graph window as oggu file and share with me so i can try?

Thanks, Snow
Go to Top of Page

dekos

8 Posts

Posted - 08/17/2021 :  10:18:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
unfortunately, repeating the command doesn't always solve it. i have to select every graph and repeat the command...
and sometimes the legend gets out of the graph...

https://my.originlab.com/ftp/forum_and_kbase/Images/Graph6.oggu
https://my.originlab.com/ftp/forum_and_kbase/Images/Graph2.oggu
https://my.originlab.com/ftp/forum_and_kbase/Images/Graph14.oggu

14 is ok, 2 is ok, 6 is not
https://my.originlab.com/ftp/forum_and_kbase/Images/Graphs-cropped.zip

Edited by - dekos on 08/17/2021 10:30:44 AM
Go to Top of Page

snowli

USA
1386 Posts

Posted - 08/17/2021 :  12:30:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,
Thanks for sending the files. Here are issue i saw:
After open them in Origin, i saw graph6 and 2 have x axis label and title out of the page.
If I hide them immediately in Origin after openning them into Origin and execute the script, ==> graph6 and 14 have x axis label and title outside the page.
So I jiraed the issue in ORG-23792 P2.

After opening them in Origin, if i activated each graph once and then hide them and execute the script no issue.

I will ask our developer to check.

Thanks, Snow
Go to Top of Page

yuki_wu

896 Posts

Posted - 12/01/2021 :  01:03:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I am glad to let you know that Origin 2022 is available!

We have fixed the bug of Fix Page to Layers (ID: ORG-23792-P2) in Origin 2022.

Please download Origin 2022 from the link below, install and have a try.
http://www.originlab.com/demodownload.aspx

Best regards,
Yuki
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