y.p.Plotter(OptsBase) : class documentation
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
command to the
axes object for all subplots.
|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||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
|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
|Method||set_semilogx||Makes x-axis logarithmic, unless called with
|Method||set_semilogy||Makes y-axis logarithmic, unless called with
|Method||set_useLabels||Has annotation labels point to each plot line instead of a legend, with
text taken from the legend list. Call with
|Method||set_grid||Adds a grid, unless called with
|Method||set_timex||Uses intelligent time scaling for the x-axis, unless called with
|Method||set_firstVectorTop||Has the first dependent vector (the second argument to the
|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
|Method||set_ylabel||Sets the y-axis label.|
|Method||clear_legend||Clears the list of legend entries.|
|Method||set_legend||Sets the list of legend entries.|
|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.|
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.
Upon completion of context, turns minor ticks and grid on if enabled for this subplot's axis, and restores global (all subplots) options.
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.
If I have a fc attribute (which must reference an instance of
FigureCanvas, then the FigureCanvas is drawn instead of
PyPlot doing a window show.
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.,
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
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
If your x-axis is for time with units in seconds, you can set
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
Any keywords you supply to this call are used to
ylabel="foo" results in a
set_ylabel("foo") command to the
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
Returns the annotator for the supplied axes object, or a list of all annotators if no axes object is supplied.