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
 Fill to Data select Data as Backgnd. code
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

linqy

1 Posts

Posted - 04/23/2024 :  12:43:18 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
How to write a python program to make Fill to Data Plot directly select Data as Backgnd. My code is:

import os
import originpro as op
wks = op.find_sheet()
graph = op.new_graph(template='XPSArea')
gl=graph[0]
plot1 = gl.add_plot(f'{wks.lt_range()}!(?,5:end)', type = 'l')
plot2 = gl.add_plot(f'{wks.lt_range()}!(?,3:4)', type = 'l')
plot3 = gl.add_plot(wks,1,0,type = 's')
g1 = gl.group(True,0,wks.cols-5)
plot1.set_fill_area(type=8)
# how to select the Backgnd. data?
gl.rescale()

YimingChen

1607 Posts

Posted - 04/24/2024 :  08:36:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You may need to call LabTalk from the Python code. Please refer to the LabTalk page: https://www.originlab.com/doc/en/LabTalk/ref/Options_for_Lines#-lfp

Here's the sample code:

import os
import originpro as op
wks = op.find_sheet()
graph = op.new_graph()
gl=graph[0]
plot1 = gl.add_plot(f'{wks.lt_range()}!(?,5:end)', type = 'l')
plot2 = gl.add_plot(f'{wks.lt_range()}!(?,3:4)', type = 'l')
plot3 = gl.add_plot(wks,1,0,type = 's')
g1 = gl.group(True,0,wks.cols-5)
plot1.set_fill_area(type=8)
str = f'range rr = {plot1.lt_range()}; set rr -lfp 3;'
gl.lt_exec(str)
# how to select the Backgnd. data?
gl.rescale()


James
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