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
 Error bar
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

korhorlefor

1 Posts

Posted - 02/10/2021 :  03:41:15 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello everybody,

does everyone know how to create error bar plots with Python?


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

Chris D

428 Posts

Posted - 02/10/2021 :  09:34:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes, not so obvious- it took me a minute.


import originpro as op

# Set up data
book = op.new_book('w')
wks = book[0]
wks.from_list(0, [1,2,3,4,5], axis='X')
wks.from_list(1, [1,2,3,4,5], axis='Y')
wks.from_list(2, [0.15,0.12,0.13,0.10,0.14], axis='E')

#Create graph and get 1st layer
graph = op.new_graph()
lay = graph[0]

# Add a scatter plot
# For `type` see: https://www.originlab.com/doc/LabTalk/ref/Plot-Type-IDs
lay.add_plot(obj=wks, coly=1, colx=0, type=201)

# Now, a bit of trickery.
# You have to add the same plot again, but use the error column as `colz`
lay.add_plot(obj=wks, coly=1, colx=0, colz=2, type=201)

lay.rescale()



Thanks,
Chris Drozdowski
Originlab Technical Support
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