OriginPro
 
Loading...
Searching...
No Matches
originpro.graph.GPage Class Reference
Inheritance diagram for originpro.graph.GPage:
originpro.base.BasePage originpro.base.BaseObject

Public Member Functions

 __repr__ (self)
 
 __getitem__ (self, index)
 
 __iter__ (self)
 
 save_fig (self, path='', type='auto', replace=True, width=0, ratio=0)
 
 add_layer (self, type=0)
 
 copy_page (self, fmt, res=300, ratio=100, tb=False)
 
- Public Member Functions inherited from originpro.base.BasePage
 __len__ (self)
 
 is_open (self)
 
 is_active (self)
 
 lt_range (self)
 
 activate (self)
 
 destroy (self)
 
 duplicate (self)
 
- Public Member Functions inherited from originpro.base.BaseObject
 __init__ (self, obj)
 
 __del__ (self)
 
 __str__ (self)
 
 __bool__ (self)
 
 index (self)
 
 get_str (self, prop)
 
 get_int (self, prop)
 
 get_float (self, prop)
 
 set_str (self, prop, value)
 
 set_int (self, prop, value)
 
 set_float (self, prop, value)
 
 method_int (self, name, arg='')
 
 method_float (self, name, arg='')
 
 method_str (self, name, arg='')
 
 lt_exec (self, labtalk)
 
 name (self)
 
 name (self, value)
 
 lname (self)
 
 lname (self, value)
 
 comments (self)
 
 comments (self, value)
 
 show (self)
 
 show (self, value)
 
 usertree (self)
 
 usertree (self, tr)
 
 userprops (self)
 

Additional Inherited Members

- Public Attributes inherited from originpro.base.BaseObject
 obj = obj
 

Detailed Description

This class represent an Origin Graph Page, it holds an instance of a PyOrigin GraphPage

Member Function Documentation

◆ add_layer()

originpro.graph.GPage.add_layer ( self,
type = 0 )
Adds a new layer to GPage. Type is based on types specified here:https://www.originlab.com/doc/X-Function/ref/layadd
but should use the index equivalent of listed types (e.g. `righty` would be 2)

Parameters:
    type (int): Type of layer to add. See description above foir how to deduce

Returns:
    (GLayer): the newly added graph layer

Examples:
    g = op.find_graph('graph1')
    gl=g.add_layer(2) # righty
    gl.xlim=[-2,1]

◆ copy_page()

originpro.graph.GPage.copy_page ( self,
fmt,
res = 300,
ratio = 100,
tb = False )
Copy Graph Page as OLE object or Image

Parameters:
    fmt (str): Image Format, can be PNG, EMF, DIB, HTML, JPG, or OLE
    res (int): DPI
    ratio (int): Size Factor (%)
    tb (bool): Background Transparency, for PNG only

Returns:
    None
examples:
    gl = op.find_graph('graph1')
    gl.copy_page('png', 600,100, True)

◆ save_fig()

originpro.graph.GPage.save_fig ( self,
path = '',
type = 'auto',
replace = True,
width = 0,
ratio = 0 )
export to a file

Parameters:
-------
path(str): if not specified, then to UFF, or if graph has theme, then last exported location in that graph.
            If specifed, can include file name with extention, which will then control image type
type(str): if auto, then use graph last exported settings, otherwise 'png', 'emf' etc
replace(bool): if file existed, silently replace or not
width(int): Pixcels. 0 will use last exported setting only if type=auto, if not auto, better specify this.
ratio (int): Size Factor (%), for emf and svg

Return:
-------
    if success, returns the fullpath file name generated, otherwise an empty string

Examples
-------
>>> g = op.find_graph('graph1')
>>> g.save_fig(op.path() + 'test1.png', width=500)
>>> g.save_fig()#use last GUI export graph settings remembered inside graph, which may include path

The documentation for this class was generated from the following file: