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
 Using a Column as Error Bars for Data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

edu404

Brazil
6 Posts

Posted - 06/11/2024 :  12:14:58 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver: 2024 Academic Operating System: Windows 10

Hi everyone,

I'm currently working on a project where I need to plot data points from a TXT file. I would like to use a specific column as error bars for my data points. However, I'm having trouble figuring out how to achieve this using the Origin Pro Python library.

Could someone guide me on the correct approach to use the column as error bars for my data points in Origin Pro using Python?

Thank you in advance for your help!

Edu

ChaoC

USA
174 Posts

Posted - 06/11/2024 :  4:40:08 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

You can use cols_axis():
https://docs.originlab.com/originpro/classoriginpro_1_1worksheet_1_1WSheet.html#ae9a1df2c0ac08ea40a8826af4e2207c6

E.g.

wks.cols_axis('xyme')

Col 1 is X
Col 2 is Y
Col 3 is x-Error
Col 4 is y-Error

Other column designation letters:

'z' = Z
'L' = Label
'g' = Group
's' = Subject
'n' = Disregard

https://www.originlab.com/doc/Origin-Help/WksCol-SetDesignation

Best,
Chao
Go to Top of Page

edu404

Brazil
6 Posts

Posted - 06/12/2024 :  08:21:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
When i open the opju file i see in the worksheet the error bar, however how i can plot this error bar using the add_plot, for example, i use coly for Y-axis, colx for X-axis and i dont know how to get the errorbar calling.


Example of my code:


for col in range(1, wks.cols):
wks.cols_axis('nnnxye')
plot = gp[0].add_plot(wks, coly='Rat_first', colx='Period [s]', cole='Rat_first.1', type = 202)
plot.color = colors[col % len(colors)]
plot.set_int('line.width', 2)
plot.set_int('lineStyle', 1)
plot.set_int('lineThickness', 1)
gp[0].rescale()

Edu

Edited by - edu404 on 06/12/2024 08:22:36 AM
Go to Top of Page

ChaoC

USA
174 Posts

Posted - 06/12/2024 :  09:17:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Please refer to the documentation:
https://docs.originlab.com/originpro/classoriginpro_1_1graph_1_1GLayer.html#a9d5148e776444f3723ee126d1781b151

Best,
Chao
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