Table of contents Index

class Data - Represents data from memory to be plotted with Gnuplot.

Declared in module Gnuplot

Inheritance hierarchy:

Gnuplot.Data
  Gnuplot.PlotItem

Synopsis

class Data(PlotItem):
    def __init__(self, *set, **keyw) # Construct a 'Data' object from a numeric array.
    def pipein(self, f)
    def set_option(self, cols=<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

Takes a numeric array from memory and outputs it to a temporary file that can be plotted by gnuplot.

__init__(self, *set, **keyw)

Construct a 'Data' object from a numeric array.

Create a Data object (which is a type of 'PlotItem') out of one or more Float Python Numeric arrays (or objects that can be converted to a Float Numeric array). If the routine is passed one array, the last index ranges over the values comprising a single data point (e.g., [x, y, and sigma]) and the rest of the indices select the data point. If the routine is passed more than one array, they must have identical shapes, and then each data point is composed of one point from each array. E.g., Data(x,x**2) is a PlotItem that represents x squared as a function of x. For the output format, see the comments for write_array().

The array is first written to a temporary file, then that file is plotted. No copy is kept in memory.

Keyword arguments:

cols=<tuple>
write only the specified columns from each data point to the file. Since cols is used by python, the columns should be numbered in the python style (starting from 0), not the gnuplot style (starting from 1).
inline=<bool>
transmit the data to gnuplot "inline" rather than through a temporary file. The default is the value of _prefer_inline_data.
The keyword arguments recognized by PlotItem can also be used here.

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

Set or change options associated with this plotitem.

Note that the cols and the inline options cannot be changed via this routine.

__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