OriginPro
Public Member Functions | List of all members
originpro.graph.GLayer Class Reference
Inheritance diagram for originpro.graph.GLayer:
originpro.base.BaseLayer originpro.base.BaseObject

Public Member Functions

def __repr__ (self)
 
def lt_range (self)
 
def rescale (self, skip='')
 
def group (self, group=True, begin=-1, end=-1)
 
def axis (self, ax)
 
def xlim (self)
 
def xlim (self, limits)
 
def ylim (self)
 
def ylim (self, limits)
 
def zlim (self)
 
def zlim (self, limits)
 
def set_xlim (self, begin=None, end=None, step=None)
 
def set_ylim (self, begin=None, end=None, step=None)
 
def set_zlim (self, begin=None, end=None, step=None)
 
def xscale (self)
 
def xscale (self, scaletype)
 
def yscale (self)
 
def yscale (self, scaletype)
 
def zscale (self)
 
def zscale (self, scaletype)
 
def label (self, name)
 
def remove_label (self, label)
 
def remove (self, any obj)
 
def plot_list (self)
 
def remove_plot (self, plot)
 
def add_plot (self, obj, coly=-1, colx=-1, colz=-1, type='?', colyerr=-1, colxerr=-1)
 
def add_mplot (self, ms, z, x=-1, y=-1, cm=-1, type=103)
 
- Public Member Functions inherited from originpro.base.BaseLayer
def __str__ (self)
 
def activate (self)
 
def destroy (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 represents an Origin Graph Layer, it holds an instance of a PyOrigin GraphLAyer

Member Function Documentation

◆ add_mplot()

def originpro.graph.GLayer.add_mplot (   self,
  ms,
  z,
  x = -1,
  y = -1,
  cm = -1,
  type = 103 
)
plot a 3D parametric surface

Parameters:
    ms (MSheet): matrix sheet with the data to plot
    z (int): matrix object index for Z
    x (int): matrix object index for X, must be > z
    y (int): matrix object index for Y, must be > z

Examples:
    #assmues X,Y,Z contains the mesh grid data
    data=[]
    data.append(Z)
    data.append(X)
    data.append(Y)
    ms = op.new_sheet('m')
    ms.from_np(np.array(data))
    gl = op.new_graph(template='GLparafunc')[0]
    gl.add_mplot(ms, 0, 1, 2)

◆ add_plot()

def originpro.graph.GLayer.add_plot (   self,
  obj,
  coly = -1,
  colx = -1,
  colz = -1,
  type = '?',
  colyerr = -1,
  colxerr = -1 
)
Add plot to graph layer
Parameters:
    obj(WSheet): worksheet to plot from, or a DataRange
    coly(int or str): Y column to plot
    colx(int or str): X column, it not specified, X column on the left, can use '#' to indicate use row number as X
    colz(int or str): Z column to plot
    type(str): 'l'(Line Plot) 's'(Scatter Plot) 'y' (Line Symbols) 'c' (Column) '?' auto(template)
    colyerr(int or str): Y Error column to plot
    colxerr(int or str): X Error column to plot
Returns:
    (Plot): the newly added Plot object

Examples:
    gl = op.find_graph()[0]
    wks = op.find_sheet('w','Book1')
    p = gl.add_plot(wks,'C')
    p.color = '#5f0'
    gl.rescale()
    gl.add_plot(wks,1,3)#C(x), B(y)
    gl.add_plot(wks,1,'#')#B(y) vs Row Numbers

◆ axis()

def originpro.graph.GLayer.axis (   self,
  ax 
)
Creates a new Axis object

Parameters:
    ax (str): One of 'x', 'y', or 'z'

Returns:
    (Axis)

Examples:
    ax = lay.axis('x')

◆ group()

def originpro.graph.GLayer.group (   self,
  group = True,
  begin = -1,
  end = -1 
)
Group/Ungroup data plots

Parameters:
    begin(int): plot index, -1 is the same as 0
    end(int): -1 to the last, otherwise ending plot index (0-offset)

Examples:
    graph = op.new_graph(template='scatter')
    gl=graph[0]
    plot = gl.add_plot('[Book1]1!(A,B:C)', type='s')
    gl.group(True,0,1)
    plot = gl.add_plot('[Book1]1!(A,D:0)', type='l')
    gl.group(True,2,3)

◆ label()

def originpro.graph.GLayer.label (   self,
  name 
)
Get a Label instance by name.

Parameters:
    name (str): name of the label to be attached
Returns:
    (Label)

Examples:
    g = op.new_graph()
    g[0].label('XB').remove()

◆ lt_range()

def originpro.graph.GLayer.lt_range (   self)
Return the Origin Range String that identify Graph Layer object

◆ plot_list()

def originpro.graph.GLayer.plot_list (   self)
Returns list of Plot objects in the layer.

Parameters:

Returns:
    (list)

Examples:
    items = lay.plot_list()
    item = lay.plot_list()[0]

◆ remove()

def originpro.graph.GLayer.remove (   self,
any  obj 
)
Returns object in the layer.

Parameters:
    obj: Can be graph object or plot object

Returns:
    None

Examples:
    items = lay.plot_list()
    item = lay.plot_list()[0]

◆ remove_label()

def originpro.graph.GLayer.remove_label (   self,
  label 
)
Remove a label from a layer.

Parameters:
    label (Label or str): Instance of Label or name of label to remove

Returns:
    None

Examples:
    g = op.new_graph()
    g[0].remove_label('xb') # g[0] is 1st layer.

◆ remove_plot()

def originpro.graph.GLayer.remove_plot (   self,
  plot 
)
Removes plot from layer.

Parameters:
    plot (Plot or int) Instance of Plot or index of plot to remove

Returns:
    None

Examples:
    lay.remove_plot(3)

◆ rescale()

def originpro.graph.GLayer.rescale (   self,
  skip = '' 
)
update limits to show all the data, including color scale range is colormap is used

Parameters:
    skip(str): axis to skip(keep limits). Can be a combination of x,y,z,m where m is for colormap

Returns:
    None

Examples:
    gl=op.find_graph()[0]
    gl.rescale('x')#rescale Y only
    gl.rescale('m')#do not change colormap scale range

◆ set_xlim()

def originpro.graph.GLayer.set_xlim (   self,
  begin = None,
  end = None,
  step = None 
)
Sets X axis scale begin(From), end(To) and step(Increment)

Parameters:
    begin (float or None): axis new From or Begin value.
    end (float or None): axis new To or End value.
    step (float or None): axis new Step or Increment value.

Returns:
    New axis limits

Examples:
    g = op.new_graph()
    g[0].set_xlim(0, 1)
    g[0].set_xlim(step=0.2)

◆ set_ylim()

def originpro.graph.GLayer.set_ylim (   self,
  begin = None,
  end = None,
  step = None 
)
Sets Y axis scale begin(From), end(To) and step(Increment)

Parameters:
    begin (float or None): axis new From or Begin value.
    end (float or None): axis new To or End value.
    step (float or None): axis new Step or Increment value.

Returns:
    New axis limits

Examples:
    g = op.new_graph()
    g[0].set_ylim(1, 100, 20)
    g[0].set_ylim(begin=0)

◆ set_zlim()

def originpro.graph.GLayer.set_zlim (   self,
  begin = None,
  end = None,
  step = None 
)
Sets Z axis scale begin(From), end(To) and step(Increment)

Parameters:
    begin (float or None): axis new From or Begin value.
    end (float or None): axis new To or End value.
    step (float or None): axis new Step or Increment value.

Returns:
    New axis limits

Examples:
    g = op.new_graph()
    g[0].set_zlim(0, 5)
    g[0].set_zlim(step=1)

◆ xlim() [1/2]

def originpro.graph.GLayer.xlim (   self)
Property getter for X axis limits.

Parameters:

Returns:
    New X axis limits

◆ xlim() [2/2]

def originpro.graph.GLayer.xlim (   self,
  limits 
)
save as set_xlim

◆ xscale() [1/2]

def originpro.graph.GLayer.xscale (   self)
Property getter for X axis scale type.

Parameters:

Returns:
    Scale type of axis

Examples:
    st = lay.zscale

◆ xscale() [2/2]

def originpro.graph.GLayer.xscale (   self,
  scaletype 
)
Property setter for X axis scale type.

Parameters:
    scaletype (int or str): Supported string value of scaltype:
        ['linear', 'log10', 'probability', 'probit', 'reciprocal', 'offset_reciprocal', 'logit', 'ln', 'log2']

Returns:
    New scale type of x axis

Examples:
    lay.xscale = 'log10'

◆ ylim() [1/2]

def originpro.graph.GLayer.ylim (   self)
See Also:
    xlim property getter

◆ ylim() [2/2]

def originpro.graph.GLayer.ylim (   self,
  limits 
)
save as set_xlim

◆ yscale() [1/2]

def originpro.graph.GLayer.yscale (   self)
See Also:
    xscale property getter

◆ yscale() [2/2]

def originpro.graph.GLayer.yscale (   self,
  scaletype 
)
See Also:
    xscale property setter

◆ zlim() [1/2]

def originpro.graph.GLayer.zlim (   self)
See Also:
    xlim property getter

◆ zlim() [2/2]

def originpro.graph.GLayer.zlim (   self,
  limits 
)
save as set_xlim

◆ zscale() [1/2]

def originpro.graph.GLayer.zscale (   self)
 See Also:
    xscale property getter

◆ zscale() [2/2]

def originpro.graph.GLayer.zscale (   self,
  scaletype 
)
See Also:
    xscale property setter

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