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 font type & reverse the axis
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

WSY

China
2 Posts

Posted - 01/01/2024 :  11:46:26 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.9.8.0.200:
Operating System:Win 10

Hello,
I have wrote a Python script to deal with my own data, but i need to change the font type in the whole graph, such as the X axis, Y axis and the title of the graph. Besides, how to reverse the axis, the problem has puzzled me a lot. Hope I can get a proper method to figure out.

Sincerely yours,
Sheng-Ye

minimax

348 Posts

Posted - 01/01/2024 :  10:31:59 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi WSY,

You may first set up a graph theme with the desirable font, and then apply it using LabTalk (X-Function themeApply2g) script.

I suppose there is no native Python function yet, like following:


import originpro as op
gp=op.find_graph()

gpname=gp.name
gp.lt_exec('themeApply2g theme:=myFontThemeFileName graphs:=f"{gpname}"')

# set X axis as reverse
gl=gp[0]
gl.set_int('x.reverse',1)


Sample theme file:
https://my.originlab.com/ftp/forum_and_kbase/Images/Fsegoe.zip
Go to Top of Page

WSY

China
2 Posts

Posted - 01/02/2024 :  12:07:43 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi minimax,
Thanks for your help, I will have a try ASAP.

Best,
WSY
Go to Top of Page

minimax

348 Posts

Posted - 01/03/2024 :  12:09:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If all your graphs requires a same font, you can set the theme file as System Theme on Theme Organizer dialog, so that you do not need to add codes to apply.

On the other hand, you may also save a graph template with the needed font, and then
op.new_graph(template='mytemplate') will create the graph with proper font.
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