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

Public Member Functions

def __init__ (self, obj, layer)
 
def lt_range (self)
 
def color (self)
 
def color (self, rgb)
 
def colorinc (self)
 
def colorinc (self, inc)
 
def colormap (self)
 
def colormap (self, name)
 
def set_shapelist (self, name)
 
def zlevels (self)
 
def zlevels (self, dict)
 
def symbol_size (self)
 
def symbol_size (self, size)
 
def symbol_kind (self)
 
def symbol_kind (self, shape)
 
def symbol_kindinc (self)
 
def symbol_kindinc (self, inc)
 
def symbol_interior (self)
 
def symbol_interior (self, fill)
 
def symbol_sizefactor (self)
 
def symbol_sizefactor (self, fac)
 
def transparency (self)
 
def transparency (self, t)
 
def remove (self)
 
def change_data (self, wks, **kwargs)
 
def set_fill_area (self, above=-1, type=9, below=-1)
 
def set_cmd (self, *args)
 
def group (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)
 

Public Attributes

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

Properties

 shapelist = property(None, set_shapelist)
 

Detailed Description

This class represents an instance of a data plot in a GLayer.

Constructor & Destructor Documentation

◆ __init__()

def originpro.graph.Plot.__init__ (   self,
  obj,
  layer 
)

Reimplemented from originpro.base.BaseObject.

Member Function Documentation

◆ change_data()

def originpro.graph.Plot.change_data (   self,
  wks,
**  kwargs 
)
change the data source for an existing data plot

Parameters:
    wks (WSheet): the worksheet to use
    kwargs : columns and the corresponding axis
Returns:
    None
Examples:
    wks = op.find_sheet('w', 'Book1')
    gl = op.find_graph('Graph1')[0]
    dp = gl.plot_list()[0]
    dp.change_data(wks, x='C', y='D')

◆ color() [1/2]

def originpro.graph.Plot.color (   self)
returns the RGB color of the plot object as a tuple (Red, Green, Blue)

Parameters:

Returns:
    (tuple) r,g,b

Examples:
    p = g[0].plot_list()[0]
    red, green, blue = p.color

◆ color() [2/2]

def originpro.graph.Plot.color (   self,
  rgb 
)
set for the RGB color of the plot object

Parameters:
    rgb(int, str, tuple): various way to specify color, see function ocolor(rgb) in op.utils

Returns:
    None

Examples:
    p = g[0].add_plot(wks,'(0,1)')
    p.color = '#0f0'
See Also:
    ocolor(rgb)

◆ colorinc() [1/2]

def originpro.graph.Plot.colorinc (   self)
returns the color increment of the grouped plot object

Parameters:

Returns:
    (int) color increment

Examples:
    p = g[0].plot_list()[0]
    inc = p.colorinc

◆ colorinc() [2/2]

def originpro.graph.Plot.colorinc (   self,
  inc 
)
set the color increment of the plot object

Parameters:
    inc(int): color increment

Returns:
    None

Examples:
    p = g[0].add_plot(wks,'(0,1)')
    p.colorinc = 1

◆ colormap() [1/2]

def originpro.graph.Plot.colormap (   self)
Returns the colormap name a string

Parameters:

Returns:
    (str) colormap name

Examples:
    pl = g[0].plot_list()[0]
    cm = pl.colormap

◆ colormap() [2/2]

def originpro.graph.Plot.colormap (   self,
  name 
)
Set the colormap of the plot object

Parameters:
    Colormap name, can be colorlist, palette.

Returns:
    None

Examples:
    p = g[0].add_plot(wks,'(0,1)')
    p.colormap = 'Fire' # colorlist
    p.colormap = 'Maple.pal' # palette

◆ group()

def originpro.graph.Plot.group (   self)
Check if data plot in group or not.

Parameters:

Returns:
    (int) 0: Not in group, 1: Group Head, 2: Group Member

Examples:
    pl = g[0].plot_list()[0]
    group = pl.group

◆ lt_range()

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

◆ remove()

def originpro.graph.Plot.remove (   self)
Deletes plot.
Parameters:
    none
Returns:
    None
Examples:
    gl=op.find_graph()[0]
    p = gl.plot_list()[0]
    p.remove()

◆ set_cmd()

def originpro.graph.Plot.set_cmd (   self,
args 
)
Execute labtalk set command for this data plot

Parameters:
    args: set command options
Returns:
    none
Examples:
    wks = op.find_sheet('w', 'Book1')
    gl = op.find_graph('Graph1')[0]
    dp = gl.add_plot(wks, 1, 0)
    dp.set_cmd('-c 2', '-d 2') # line color as red, style as dot

◆ set_fill_area()

def originpro.graph.Plot.set_fill_area (   self,
  above = -1,
  type = 9,
  below = -1 
)
For line plots only, to set Fill Area Under curve option

Parameters:
    above (int): fill color of "Pattern Above" (or "Pattern")
    type (int): fill area option, 9=Fill to next data plot – above below colors,  see https://www.originlab.com/doc/LabTalk/ref/Set-cmd#Specifying_Pattern
    below (int): fill color of "Pattern Below"


Returns:
    none
Examples:
    gl=op.find_graph()[0]
    p=gl.plot_list()[0]
    p.set_fill_area(2, 9, 3)

◆ set_shapelist()

def originpro.graph.Plot.set_shapelist (   self,
  name 
)
Set the shape list of the plot object

Parameters:
    Shape list, can be theme file name, or integer list

Returns:
    None

Examples:
    p = g[0].add_plot(wks,'(0,1)')
    p.shapelist = 'Symbol Type Square and Circle' # theme file
    p.shapelist = [3, 2, 1]

◆ symbol_interior() [1/2]

def originpro.graph.Plot.symbol_interior (   self)
returns the symbol interior type. 0 = no symbol, 1=solid, 2=open, 3=dot center

Parameters:

Returns:
    (int) symbol interior

Examples:
    p = g[0].plot_list()[0]
    kind = p.symbol_interior

◆ symbol_interior() [2/2]

def originpro.graph.Plot.symbol_interior (   self,
  fill 
)
set symbol interior of the plot object. 0 = no symbol, 1=solid, 2=open, 3=dot center

Parameters:
    fill(int): symbol interior

Returns:
    None

Examples:
    p = g[0].add_plot(wks,'(0,1)')
    p.symbol_interior = 2

◆ symbol_kind() [1/2]

def originpro.graph.Plot.symbol_kind (   self)
returns the symbol shape, see the LabTalk get %C -k command

Parameters:

Returns:
    (int) symbol shape

Examples:
    p = g[0].plot_list()[0]
    shape = p.symbol_kind

◆ symbol_kind() [2/2]

def originpro.graph.Plot.symbol_kind (   self,
  shape 
)
set symbol shape of the plot object, see the LabTalk set %C -k command

Parameters:
    shape(int): symbol shape

Returns:
    None

Examples:
    p = g[0].add_plot(wks,'(0,1)')
    p.symbol_kind = 2

◆ symbol_kindinc() [1/2]

def originpro.graph.Plot.symbol_kindinc (   self)
returns the symbol shape increment of the grouped plot object

Parameters:

Returns:
    (int) symbol shape increment

Examples:
    p = g[0].plot_list()[0]
    shape = p.symbol_kindinc

◆ symbol_kindinc() [2/2]

def originpro.graph.Plot.symbol_kindinc (   self,
  inc 
)
set symbol shape increment of the grouped plot object

Parameters:
    inc(int): symbol shape increment

Returns:
    None

Examples:
    p = g[0].add_plot(wks,'(0,1)')
    p.symbol_kindinc = 1

◆ symbol_size() [1/2]

def originpro.graph.Plot.symbol_size (   self)
returns the symbol size, see the Labtalk get %C -z command

Parameters:

Returns:
    (float) symbol size

Examples:
    p = g[0].plot_list()[0]
    size = p.symbol_size

◆ symbol_size() [2/2]

def originpro.graph.Plot.symbol_size (   self,
  size 
)
set symbol size of the plot object, see the LabTalk set %C -z command

Parameters:
    size(float): symbol size

Returns:
    None

Examples:
    p = g[0].add_plot(wks,'(0,1)')
    p.symbol_size = 20.5

◆ symbol_sizefactor() [1/2]

def originpro.graph.Plot.symbol_sizefactor (   self)
returns the symbol size factor, 1 if not changing. This is useful when size is controlled by a worksheet column

Parameters:

Returns:
    (float) symbol size factor

Examples:
    p = g[0].plot_list()[0]
    size = p.symbol_size * p.symbol_sizefactor

◆ symbol_sizefactor() [2/2]

def originpro.graph.Plot.symbol_sizefactor (   self,
  fac 
)
set symbol size factor of the plot object. This is useful when size if controlled by a worksheet column

Parameters:
    fac(float): symbol size factor

Returns:
    None

Examples:
    p = g[0].add_plot(wks,'(0,1)')
    p.symbol_size=modi_col(1)
    p.symbol_sizefactor = 10

◆ transparency() [1/2]

def originpro.graph.Plot.transparency (   self)
returns the plot's line or symbol transparency in percent
Parameters:
    none
Returns:
    transparency in percent
Examples:
    gl=op.find_graph()[0]
    p = gl.plot_list()[0]
    print(p.transparency)

◆ transparency() [2/2]

def originpro.graph.Plot.transparency (   self,
  t 
)
set the plot's line or symbol transparency in percent
Parameters:
    t(int):0-100
Returns:
    transparency in percent
Examples:
    gl=op.find_graph()[0]
    p = gl.plot_list()[0]
    p.transparency=60

◆ zlevels() [1/2]

def originpro.graph.Plot.zlevels (   self)
Returns the information about z-levels as a dictionary
Parameters:
    none
Returns:
    dictionary of z-levels
Examples:
    gl=op.find_graph()[0]
    p = gl.plot_list()[0]
    print(p.zlevels)

◆ zlevels() [2/2]

def originpro.graph.Plot.zlevels (   self,
  dict 
)
set the z-levels from the modified dictionary returned from the getter

Examples:
    msheet = op.find_sheet('m', '[MBook1]')
    graph = op.new_graph(template='contour')
    gl = graph[0];
    plot = gl.add_mplot(msheet, z=0, type='contour')
    gl.rescale()
    z = plot.zlevels
    z['minors'] = 4
    z['levels'] = [0, 5, 10, 15,20]
    plot.zlevels = z
    plot.colormap = 'Beach.pal'

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