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
 Origin Forum
 Create stack graph in python originpro

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
Tao_Zhang Posted - 01/13/2025 : 4:11:55 PM
I'm trying to write a python script to plot in origin using originpro package. I use the following line to create a stack graph.

graph = op.new_graph(template='stack')

When I create the graph using the above line, it has only one layer. I use the graph.add_layer() function to add more layers, but it messy.

How can I specify the number of layers in the stack graph so that it can organize the layout correctly when creating the graph?

2   L A T E S T    R E P L I E S    (Newest First)
Tao_Zhang Posted - 01/14/2025 : 12:15:52 PM
Thank you so much, Nicholas! It's perfect for me.

quote:
Originally posted by NicholasSupport

Hello Tao_Zhang,

I think it will be less messy to use the 'plotstack' X-Function via lt_exec.

This will let you specify the X and Y pairs and allow you to use all the options that come with the X-Function itself.

import os
import originpro as op

wks = op.new_sheet()
wks.from_file(os.path.join(op.path('e'), 'Samples', 'Graphing', 'Group.dat'))
wks.lt_exec('plotstack iy:=((1,2), (1,3), (1,4))')


For more information on the 'plotstack' X-Function, visit this page:
https://www.originlab.com/doc/X-Function/ref/plotstack

Let me know if this is an appropriate solution for your scenario, and if any other questions arise.

Best,

Nicholas G.
nicholas@originlab.com
OriginLab Technical Support Team

NicholasSupport Posted - 01/13/2025 : 9:04:02 PM
Hello Tao_Zhang,

I think it will be less messy to use the 'plotstack' X-Function via lt_exec.

This will let you specify the X and Y pairs and allow you to use all the options that come with the X-Function itself.

import os
import originpro as op

wks = op.new_sheet()
wks.from_file(os.path.join(op.path('e'), 'Samples', 'Graphing', 'Group.dat'))
wks.lt_exec('plotstack iy:=((1,2), (1,3), (1,4))')


For more information on the 'plotstack' X-Function, visit this page:
https://www.originlab.com/doc/X-Function/ref/plotstack

Let me know if this is an appropriate solution for your scenario, and if any other questions arise.

Best,

Nicholas G.
nicholas@originlab.com
OriginLab Technical Support Team

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