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
 Line width and addline

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
cts18488 Posted - 11/15/2021 : 12:40:06 PM
Origin Ver. 2021b and Service Release SR2 (Select Help-->About Origin):
Operating System: Win10 Ent

Hi,

Is it possible to change the line width of a graph using External Python? Also, can a straight line be inserted with a command line like in this example: https://www.originlab.com/doc/X-Function/ref/addline?

Thank you,
Tibi
7   L A T E S T    R E P L I E S    (Newest First)
cts18488 Posted - 11/16/2021 : 5:26:10 PM
Thank you! It's working!

Appreciate your help!

I prefer this way as I want to add the zero line when certain conditions are met.

quote:
Originally posted by cpyang

You can control such axes properties with set_int, like


gl_1.set_int("x.AtZero",1)


Details on such LabTalk properties can be found at

https://www.originlab.com/doc/LabTalk/ref/Layer-Axis-obj

CP


cpyang Posted - 11/16/2021 : 4:19:31 PM
You can control such axes properties with set_int, like


gl_1.set_int("x.AtZero",1)


Details on such LabTalk properties can be found at

https://www.originlab.com/doc/LabTalk/ref/Layer-Axis-obj

CP
cpyang Posted - 11/16/2021 : 4:10:09 PM
If you just need to show a horizontal line at Y=0, you can turn it on from GUI and save into your template.




CP
cts18488 Posted - 11/16/2021 : 08:08:55 AM
I have tried that and it still doesn't work.

quote:
Originally posted by YimingChen

You may need to specify the graph layer to run the LT script, the the script below:
gl_1.lt_exec("addline type:=1 value:=12 select:=1 name:=vline1;")


James

YimingChen Posted - 11/15/2021 : 5:18:36 PM
You may need to specify the graph layer to run the LT script, the the script below:
gl_1.lt_exec("addline type:=1 value:=12 select:=1 name:=vline1;")


James
cts18488 Posted - 11/15/2021 : 3:18:40 PM
It worked to change the line width. However, the second option, did not work. This is what I have tried:

gl_1 = gr[0]
p1 = gl_1.add_plot(wks, 1, 0, type=230) # X is col A, Y is col B. 202 is Line + Symbol.
p1.set_int('line.width', 10) # set the line width
op.lt_exec("addline type:=1 value:=0 select:=1 name:=hline1;")

gl_1.rescale()

I want an horizontal line at value 0.

Thank you,
Tibi

quote:
Originally posted by YimingChen

1. To set line width:
plot.set_int('line.width', 6)

2. To run Xfunction from Python, try:
op.lt_exec("addline type:=1 value:=12 select:=1 name:=vline1;")


James

YimingChen Posted - 11/15/2021 : 2:00:17 PM
1. To set line width:
plot.set_int('line.width', 6)

2. To run Xfunction from Python, try:
op.lt_exec("addline type:=1 value:=12 select:=1 name:=vline1;")


James

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