y.p.Plotter(OptsBase) : class documentation

Part of yampex.plot View In Hierarchy Source for plot.py Project Page for yampex

I provide a Figure with one or more time-vector and XY subplots of Numpy vectors using Matplotlib.

Construct an instance of me with the total number of subplots (to be intelligently apportioned into one or more rows and columns) or, with two constructor arguments, the number of columns followed by the number of rows.

You can specify a PNG file to write the Figure to instead of displaying it with the filePath keyword.

You can set the width and height of the Figure in inches (100 DPI) with constructor keywords.

Any other keywords you supply to the constructor are used to set_X the axes for all subplots. For example, yticks=[1,2,3] results in a set_yticks([1,2,3]) command to the axes object for all subplots.

Method __init__ Undocumented
Method __getattr__ Undocumented
Method __enter__ Upon context entry, sets up the next (first) subplot with cleared axes, preserves a copy of my global (all subplots) options, and returns a reference to myself.
Method __exit__ Upon completion of context, turns minor ticks and grid on if enabled for this subplot's axis, and restores global (all subplots) options.
Method N_cols Undocumented
Method post_op Call this once after each subplot: Adds minor ticks and a grid, depending on the subplot-specific options. Then sets my opts dict to a copy of the global (all subplots) options.
Method show If I have a fc attribute (which must reference an instance of Qt's FigureCanvas, then the FigureCanvas is drawn instead of PyPlot doing a window show.
Method getColor Undocumented
Method xBounds Undocumented
Method yBounds Undocumented
Method scaleTime Undocumented
Method parseArgs Undocumented
Method addLegend Undocumented
Method __call__ No summary
Method get_annotators Returns the annotator for the supplied axes object, or a list of all annotators if no axes object is supplied.

Inherited from OptsBase:

Method set_loglog Makes both axes logarithmic, unless called with False.
Method set_semilogx Makes x-axis logarithmic, unless called with False.
Method set_semilogy Makes y-axis logarithmic, unless called with False.
Method set_useLabels Has annotation labels point to each plot line instead of a legend, with text taken from the legend list. Call with False to revert to default legend-box behavior.
Method set_grid Adds a grid, unless called with False.
Method set_timex Uses intelligent time scaling for the x-axis, unless called with False.
Method set_firstVectorTop Has the first dependent vector (the second argument to the Plotter object call) determine the top (maximum) of the displayed plot boundary.
Method set_bump No summary
Method set_zeroBottom No summary
Method add_marker No summary
Method add_line No summary
Method set_yscale Manually sets the y-axis scaling.
Method set_axvline Adds a vertical dashed line at the data point with index k.
Method set_xlabel Sets the x-axis label. (Ignored if time-x mode has been activated with a call to set_timex.)
Method set_ylabel Sets the y-axis label.
Method add_legend No summary
Method clear_legend Clears the list of legend entries.
Method set_legend Sets the list of legend entries.
Method add_annotation No summary
Method clear_annotations Clears the list of annotations.
Method set_title Sets a subplot title. You may include a text prototype with format-substitution args, or just supply the final text string with no further arguments.
def __init__(self, N, *args, **kw):
Undocumented
def __getattr__(self, name):
Undocumented
def __enter__(self):

Upon context entry, sets up the next (first) subplot with cleared axes, preserves a copy of my global (all subplots) options, and returns a reference to myself.

def __exit__(self, exc_type, exc_val, exc_tb):

Upon completion of context, turns minor ticks and grid on if enabled for this subplot's axis, and restores global (all subplots) options.

def N_cols(self, N):
Undocumented
def post_op(self):

Call this once after each subplot: Adds minor ticks and a grid, depending on the subplot-specific options. Then sets my opts dict to a copy of the global (all subplots) options.

def show(self, windowTitle=None):

If I have a fc attribute (which must reference an instance of Qt's FigureCanvas, then the FigureCanvas is drawn instead of PyPlot doing a window show.

def getColor(self, k):
Undocumented
def xBounds(self, *args, **kw):
Undocumented
def yBounds(self, *args, **kw):
Undocumented
def scaleTime(self, vectors):
Undocumented
def parseArgs(self, args):
Undocumented
def addLegend(thisVector, thisLegend):
Undocumented
def __call__(self, *args, **kw):

Plots the second supplied vector (and any further ones) versus the first in the next subplot. If you supply an object that houses vectors and provides access to them as items, e.g., analysis.sim.Vectors of the pingspice package, as the first argument, you can supply vector names instead of the vectors themselves.

Options are set via the methods in OptsBase, including a title, a list of plot markers and linestyles, and a list of legend entries for the plots with those keywords. legend can also be set True to use the default Matplotlib legend.

Set useLabels to True to have annotation labels pointing to each plot line instead of a legend, with text taken from the legend list. (Works best in interactive apps.)

Add other text annotations by the sample index of the point within the independent (first) and dependent vectors, the text, and the vector index. The vector index starts with 0 for the second vector argument and first dependent variable vector.

Rescale all vectors after the first dependent one, relative to that first dependent one, by supplying a yscale. This will result in two different twinned x-axes (one for the first dependent vector and one for everybody else) and a different y-axis label on the right.

If you don't provide any such yScale, you can set bump to True to bump the common y-axis upper limit to 120% of what Matplotlib decides.

If your x-axis is for time with units in seconds, you can set timex to True and the x values will be in set to the most sensible units, e.g., nanoseconds for values < 1E-6. Any 'xlabel' keyword is disregarded in such case because the x label is set automatically.

Any keywords you supply to this call are used to set_X the axes, e.g., ylabel="foo" results in a set_ylabel("foo") command to the axes object, for this subplot only.

If you want to do everything with the next subplot on your own and only want a reference to its Axes object, just call this with no args. You can still supply keywords to do set_X stuff if you wish.

def get_annotators(self, ax=None):

Returns the annotator for the supplied axes object, or a list of all annotators if no axes object is supplied.

API Documentation for yampex, generated by pydoctor at 2018-09-19 15:04:47.