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

Public Member Functions

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

Public Attributes

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

Protected Member Functions

 _format_property (self, prop)
 

Properties

 shapelist = property(None, set_shapelist)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __init__()

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

Reimplemented from originpro.base.BaseObject.

Member Function Documentation

◆ change_data()

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]

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]

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]

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]

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]

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]

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

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

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

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

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

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

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]

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]

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]

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]

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]

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]

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]

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]

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]

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]

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]

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]

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]

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]

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: