If using the `originpro` package, try:
import originpro as op
text = 'This is a label'
gr = op.find_graph('Graph1')
lay = gr[0]
lay.obj.LT_execute(f'label -a 10 10 "{text}"')
BUT, you really are better off using graph templates. We have a nice blog about how to do it:
http://blog.originlab.com/origin-graph-templates-for-python-developers
Put your label on the template because you can style and position it really nicely.
Later in your Python code, you can set it's text like
gr = op.find_graph() # Active graph
lay = gr[0] # First layer
label = lay.label('my_label')
label.text = 'Some sort of text'
Thanks,
Chris Drozdowski
Originlab Technical Support