Table of contents Index

class GridData - Holds data representing a function of two variables, for use in splot.

Declared in module Gnuplot

Inheritance hierarchy:

Gnuplot.GridData
  Gnuplot.PlotItem

Synopsis

class GridData(PlotItem):
    def __init__(self, data, xvals=None, yvals=None, binary=1, inline=<class Gnuplot._unset at 14019cc00>, **keyw) # GridData constructor.
    def pipein(self, f)
    def set_option(self, binary=<class Gnuplot._unset at 14019cc00>, inline=<class Gnuplot._unset at 14019cc00>, **keyw) # Set or change options associated with this plotitem.

    # Inherited from Gnuplot.PlotItem
    def __init__(self, basecommand, **keyw) # Construct a 'PlotItem'.
    def clear_option(self, name) # Clear (unset) a plot option.  No error if option was not set.
    def command(self) # Build the 'plot' command to be sent to gnuplot.
    def get_option(self, name) # Return the setting of an option.  May be overridden.
    def pipein(self, f) # Pipe necessary inline data to gnuplot.
    def set_option(self, with=<class Gnuplot._unset at 14019cc00>, title=<class Gnuplot._unset at 14019cc00>, **keyw) # Set or change a plot option for this PlotItem.

Description

GridData represents a function that has been tabulated on a rectangular grid. The data are written to a file; no copy is kept in memory.

__init__(self, data, xvals=None, yvals=None, binary=1, inline=<class Gnuplot._unset at 14019cc00>, **keyw)

GridData constructor.

data must be a data array holding the values of a function f(x,y) tabulated on a grid of points, such that 'data[i,j] == f(xvals[i], yvals[j])'. If xvals and/or yvals are omitted, integers (starting with 0) are used for that coordinate. The data are written to a temporary file; no copy of the data is kept in memory.

If binary=0 then the data are written to a datafile as 'x y f(x,y)' triplets (y changes most rapidly) that can be used by gnuplot's splot command. Blank lines are included each time the value of x changes so that gnuplot knows to plot a surface through the data.

If binary=1 then the data are written to a file in a binary format that splot can understand. Binary format is faster and usually saves disk space but is not human-readable. If your version of gnuplot doesn't support binary format (it is a recently-added feature), this behavior can be disabled by setting the configuration variable _recognizes_binary_splot=0 at the top of this file.

Thus if you have three arrays in the above format and a Gnuplot instance called g, you can plot your data by typing g.splot(Gnuplot.GridData(data,xvals,yvals)).

set_option(self, binary=<class Gnuplot._unset at 14019cc00>, inline=<class Gnuplot._unset at 14019cc00>, **keyw)

Set or change options associated with this plotitem.

Note that the binary and inline options cannot be changed.

__init__(self, basecommand, **keyw)

Construct a 'PlotItem'.

Keyword options:

with=<string>
choose how item will be plotted, e.g., with='points 3 3'.
title=<string>
set the title to be associated with the item in the plot legend.
title=None
choose notitle option (omit item from legend).
Note that omitting the title option is different than setting `title=None'; the former chooses gnuplot's default whereas the latter chooses `notitle'.

command(self)

Build the 'plot' command to be sent to gnuplot.

Build and return the plot command, with options, necessary to display this item.

pipein(self, f)

Pipe necessary inline data to gnuplot.

If the plot command requires data to be put on stdin (i.e., 'plot "-"'), this method should put that data there. Can be overridden in derived classes.

set_option(self, with=<class Gnuplot._unset at 14019cc00>, title=<class Gnuplot._unset at 14019cc00>, **keyw)

Set or change a plot option for this PlotItem.

See documentation for __init__ for information about allowed options. This function should be overridden by derived classes to allow additional options.
Valid HTML 4.0! Made with CSS