OriginPro
 
Loading...
Searching...
No Matches
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 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)
 
def label (self, name)
 
def remove_label (self, label)
 
def add_label (self, text, x=None, y=None)
 
def add_line (self, x1, y1, x2, y2)
 
- 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)
Returns:
    None
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)

◆ lt_range()

def originpro.graph.GLayer.lt_range (   self)
Return the Origin Range String that identify Graph Layer object
Parameters:
    none
Returns:
    Origin Range String
Examples:
    gl=op.find_graph()[0]
    print(gl.lt_range())

◆ 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 
)
remove object in the layer.

Parameters:
    obj: Can be graph object or plot object

Returns:
    None

Examples:
    gl=op.find_graph()[0]
    label = gl.label('xb')
    label.remove()

◆ 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:
    none
Returns:
    New X axis limits
Examples:
    gl=op.find_graph()[0]
    print(gl.xlim)

◆ xlim() [2/2]

def originpro.graph.GLayer.xlim (   self,
  limits 
)
Sets X axis scale begin(From), end(To) and step(Increment)
Parameters:
    limit(axis scale):(begin,end, step)
Returns:
    New axis limits
Examples:
    gl=op.find_graph()[0]
    gl.xlim=(2,9,3)

◆ 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.xscale

◆ 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)
Property getter for Y axis limits.
Parameters:
    none
Returns:
    Y axis limits
Examples:
    gl=op.find_graph()[0]
    print(gl.ylim)

◆ ylim() [2/2]

def originpro.graph.GLayer.ylim (   self,
  limits 
)
Sets Y axis scale begin(From), end(To) and step(Increment)
Parameters:
    limit(axis scale):(begin,end, step)
Returns:
    New axis limits
Examples:
    gl=op.find_graph()[0]
    gl.ylim=(2,9,3)

◆ yscale() [1/2]

def originpro.graph.GLayer.yscale (   self)
Property getter for Y axis scale type.
Parameters:
    none
Returns:
    Scale type of axis
Examples:
    st = lay.yscale

◆ yscale() [2/2]

def originpro.graph.GLayer.yscale (   self,
  scaletype 
)
Property setter for Y 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 y axis
Examples:
    lay.yscale = 'log10'

◆ zlim() [1/2]

def originpro.graph.GLayer.zlim (   self)
Property getter for Z axis limits.
Parameters:
    none
Returns:
    Z axis limits
Examples:
    gl=op.find_graph()[0]
    print(gl.zlim)

◆ zlim() [2/2]

def originpro.graph.GLayer.zlim (   self,
  limits 
)
Sets Z axis scale begin(From), end(To) and step(Increment)
Parameters:
    limit(axis scale):(begin,end, step)
Returns:
    New axis limits
Examples:
    gl=op.find_graph()[0]
    gl.zlim=(2,9,3)

◆ zscale() [1/2]

def originpro.graph.GLayer.zscale (   self)
Property getter for Z axis scale type.
Parameters:
    none
Returns:
    Scale type of axis
Examples:
    st = lay.yscale

◆ zscale() [2/2]

def originpro.graph.GLayer.zscale (   self,
  scaletype 
)
Property setter for Z 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 z axis
Examples:
    lay.zscale = 'log10'

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