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 for Programming
 Forum for Python
 Fill to Data select Data as Backgnd. code

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
linqy Posted - 04/23/2024 : 12:43:18 PM
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()

1   L A T E S T    R E P L I E S    (Newest First)
YimingChen Posted - 04/24/2024 : 08:36:07 AM
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

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