Home | Trees | Indices | Help |
---|
|
Plotitem represents an item that can be plotted by gnuplot. For the finest control over the output, you can create 'PlotItems' yourself with additional keyword options, or derive new classes from 'PlotItem'. The handling of options is complicated by the attempt to allow options and their setting mechanism to be inherited conveniently. Note first that there are some options that can only be set in the constructor then never modified, and others that can be set in the constructor and/or modified using the 'set_option()' member function. The former are always processed within '__init__'. The latter are always processed within 'set_option', which is called by the constructor. 'set_option' is driven by a class-wide dictionary called '_option_list', which is a mapping '{ <option> : <setter> }' from option name to the function object used to set or change the option. <setter> is a function object that takes two parameters: 'self' (the 'PlotItem' instance) and the new value requested for the option. If <setter> is 'None', then the option is not allowed to be changed after construction and an exception is raised. Any 'PlotItem' that needs to add options can add to this dictionary within its class definition. Follow one of the examples in this file. Alternatively it could override the 'set_option' member function if it needs to do wilder things. Members: '_basecommand' -- a string holding the elementary argument that must be passed to gnuplot's `plot' command for this item; e.g., 'sin(x)' or '"filename.dat"'. '_options' -- a dictionary of (<option>,<string>) tuples corresponding to the plot options that have been set for this instance of the PlotItem. <option> is the option as specified by the user; <string> is the string that needs to be set in the command line to set that option (or None if no string is needed). Example:: {'title' : ('Data', 'title "Data"'), 'with' : ('linespoints', 'with linespoints')}
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
_option_list = {'axes': lambda self, axes: self.set_string_opt
|
|||
_option_sequence = ['binary', 'index', 'every', 'thru', 'using
|
|
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'. |
Return the setting of an option. May be overridden. |
Set or change a plot option for this PlotItem. See documentation for '__init__' for information about allowed options. This function can be overridden by derived classes to allow additional options, in which case those options will also be allowed by '__init__' for the derived class. However, it is easier to define a new '_option_list' variable for the derived class. |
Clear (unset) a plot option. No error if option was not set. |
Build the plot command to be sent to gnuplot. Build and return the plot command, with options, necessary to display this item. If anything else needs to be done once per plot, it can be done here too. |
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. |
|
_option_list
|
_option_sequence
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Jun 9 23:05:09 2010 | http://epydoc.sourceforge.net |