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
 Forum for Python
 How to change the "divide by factor"?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ChemistryGuy

Australia
49 Posts

Posted - 06/14/2022 :  4:50:30 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: 2022b
Operating System: Windows 11

I am writing a PyCharm script to to generate a graph with an axis that uses the "divide by factor" feature.

If I generate my graph using a template, I can ensure that the axis has a "divide by factor" in use. However, I do not know in advance what value for the "divide by factor" is suitable for my data set.

I can calculate a suitable value for the "divide by factor" within my PyCharm script, based on my data set. But the problem is that I could not find a way to change the value of the "divide by factor" in the Origin graph itself.

Please would you advise me if there is a way to programmatically alter this value?

minimax

351 Posts

Posted - 06/14/2022 :  10:42:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I think there is no raw python interface now.

So you may use Labtalk instead, like

gp = op.find_graph()
gl = gp[0]
fac = 10
gl.lt_exec(f'layer.x1.label.divideby={fac}')


https://www.originlab.com/doc/LabTalk/ref/Layer-Axis-Label-obj
Go to Top of Page

ChemistryGuy

Australia
49 Posts

Posted - 06/16/2022 :  02:11:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you for this advice, I gave it a try and it worked perfectly!

And good to know there are additional functions available in LabTalk I will keep this in mind.
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