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
 All Forums
 Origin Forum for Programming
 Forum for Python
 How to add axis labels

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
cts18488 Posted - 06/20/2022 : 4:30:56 PM
Origin Ver. 2021b and Service Release (Select Help-->About Origin): SR2
Operating System: Windows 10 Enterprise

Hi,

Can you please tell me what is the code to add an axis label? Also, I want to include in the label a variable from python (please see the example below)

x = 100
The axis label in python: "the grid separation is x meters"
and the following one to appear in Origin as an axis label: the grid separation is 100 meters.

Thank you,
Tibi
4   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 06/24/2022 : 12:27:19 PM
quote:
Originally posted by cts18488

Thank you!

And how can I make it bold? What would be the command?

Tibi




Bold etc are formatting escapes for any text labels on a graph, called Origin Rich Text, see

https://www.originlab.com/doc/en/Origin-Help/Escape-Sequences

So in the case above, you use


gl.axis('x').title = f'\\b(the grid separation is {val} meters)'


Double backslash is needed since Python is also using backslash for escape character.

CP
cts18488 Posted - 06/24/2022 : 12:10:33 PM
Thank you!

And how can I make it bold? What would be the command?

Tibi
quote:
Originally posted by cpyang

I assume axis label you mean axis title?


import originpro as op
graph = op.new_graph(template='line')
gl = graph[0]
val=10
gl.axis('x').title = f'the grid separation is {val} meters'


CP


cpyang Posted - 06/20/2022 : 5:37:58 PM
I assume axis label you mean axis title?


import originpro as op
graph = op.new_graph(template='line')
gl = graph[0]
val=10
gl.axis('x').title = f'the grid separation is {val} meters'


CP
cts18488 Posted - 06/20/2022 : 4:34:27 PM
also, can you tell me how to specify which axis to use? X or Y axis.
quote:
Originally posted by cts18488

Origin Ver. 2021b and Service Release (Select Help-->About Origin): SR2
Operating System: Windows 10 Enterprise

Hi,

Can you please tell me what is the code to add an axis label? Also, I want to include in the label a variable from python (please see the example below)

x = 100
The axis label in python: "the grid separation is x meters"
and the following one to appear in Origin as an axis label: the grid separation is 100 meters.

Thank you,
Tibi


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000