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
 Inquiry on Adding an Inset Graph in OriginPro

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
edu404 Posted - 06/03/2024 : 07:52:06 AM
Origin Ver 2024 Academic.
Operating System: Windows 10


Hello OriginLab community,

I'm seeking assistance on how to add an inset graph within a main graph using OriginPro. I've been exploring various methods to achieve this, including utilizing Python scripting with the originpro library.

However, I've encountered challenges in positioning the inset graph correctly within the main graph. I've attempted to use different approaches, such as directly setting the position and size of the inset graph or utilizing specific functions like lt_execute, but haven't been successful so far.

Could anyone provide guidance or best practices on how to effectively add an inset graph within a main graph in OriginPro?

Any insights or examples demonstrating the process would be greatly appreciated.

Thank you for your assistance.

Best regards,
[Edu]

Edu
2   L A T E S T    R E P L I E S    (Newest First)
edu404 Posted - 06/04/2024 : 09:08:22 AM
quote:
Originally posted by YimingChen

The inset graph is inherently a second layer. Suppose you have two layers on one graph, and set the second layer as the inset of the first layer.
You can link the second layer to the first layer, set the layer size/position unit to be % of the first layer. This allows you to accurately control the size of the inset layer. Here is a sample LabTalk script:

page.active=2; // activate the second layer
layer.link=1;  // link the second layer to the first layer
layer.unit=7;  // set the layer position/size unit to be % of linked layer 
layer.left=0;  
layer.top = 0;
layer.width = 25;
layer.height = 20;


The Python script example

import originpro as op
gp = op.find_graph()
gl = gp[1]
gl.set_int("link",1)
gl.set_int("unit",7)
gl.set_int("left", 0)
gl.set_int("top",0)
gl.set_int("width",25)
gl.set_int("height",20)


James



It Works!! Thanks!!

Edu
YimingChen Posted - 06/03/2024 : 11:43:57 AM
The inset graph is inherently a second layer. Suppose you have two layers on one graph, and set the second layer as the inset of the first layer.
You can link the second layer to the first layer, set the layer size/position unit to be % of the first layer. This allows you to accurately control the size of the inset layer. Here is a sample LabTalk script:

page.active=2; // activate the second layer
layer.link=1;  // link the second layer to the first layer
layer.unit=7;  // set the layer position/size unit to be % of linked layer 
layer.left=0;  
layer.top = 0;
layer.width = 25;
layer.height = 20;


The Python script example

import originpro as op
gp = op.find_graph()
gl = gp[1]
gl.set_int("link",1)
gl.set_int("unit",7)
gl.set_int("left", 0)
gl.set_int("top",0)
gl.set_int("width",25)
gl.set_int("height",20)


James

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