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

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

Additional Inherited Members

- Public Attributes inherited from originpro.base.BaseObject
 obj
 

Detailed Description

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

Member Function Documentation

◆ add_layer()

def 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()

def 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()

def 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: