I handle your subplots, boundary setting and ticks. A Plotter instance constructs me with a reference to itself and an integer number of columns and rows.

If you want one row (or multiple rows) to have twice the height of normal rows, supply its index in a sequence or set with the h2 constructor keyword. Similarly, if you want one column (or multiple columns) to have twice the width of normal columns, supply its index in a sequence or set with the w2 constructor keyword.

This is a convenient way to put emphasis on one or some subplots without making things overly complicated. And if you think you need a subplot to be more than twice as high or wide as the others, think again; your figure would look terrible.

TODO: Support axis twinning, and a subplot spanning multple columns in one row.

Parametersh2A single index, or a sequence or set containing one or more indices, of any rows (starting with 0 for the top row) that have twice the normal height. If an invalid index is included, an exception will be raised.
w2A single index, or a sequence or set containing one or more indices, of any columns (starting with 0 for the left column) that have twice the normal width. If an invalid index is included, an exception will be raised.
Instance Variable p An instance of Plotter that handles all subplots in a Matplotlib Figure.
Instance Variable N Number of subplots (no greater than Nc*Nr).
Instance Variable Nc Number of columns.
Instance Variable Nr Number of rows.
Method __init__ Undocumented
Method setup Clears the figure and sets up a new set of subplots.
Method ax The Axes object for the current subplot.
Method __iter__ I can iterate over the Axes objects of subplots I've generated so far.
Method __len__ My length is the number of subplots I've generated so far.
Method __getitem__ Returns the Axes object for my subplot with index k, or the current one if k is None.
Method set_ Performs a set_ call on my last-generated subplot, where the first argument what is the suffix to the underlying "set_" method and name is what is being set.
Method xBounds Undocumented
Method yBounds No summary
Method twinx Creates and returns a twin of the last (or supplied) axes object.
Method getTwins Returns a list of the twins for the last (or supplied) axes object, starting with the axes object itself and then the twins in the order they were created.
Method setTicks Call with a dict defining ticks for 'x' and 'y' axes. Each axis has a sub-dict that may include 'major' and 'minor' entries.
Method kFix If subplot index k is None, returns the index of the current subplot, or the first one if there is not yet a current one.
Method onTop Returns True if the current subplot (or one specified with a subplot index k) will appear at the top of a column of subplots.
Method atBottom Returns True if the current subplot (or one specified with a subplot index k) will appear at the bottom of a column of subplots.
Method onLeft Returns True if the current subplot (or one specified with a subplot index k) will appear in the leftmost column of subplots.
Method _doublings Undocumented
p =
An instance of Plotter that handles all subplots in a Matplotlib Figure.
N =
Number of subplots (no greater than Nc*Nr).
Nc =
Number of columns.
Nr =
Number of rows.
def __init__(self, plotter, N, Nc, Nr, h2=None, w2=None):
Undocumented
def _doublings(self, which, seqset, N):
Undocumented
def setup(self):

Clears the figure and sets up a new set of subplots.

@property
def ax(self):

The Axes object for the current subplot.

def __iter__(self):

I can iterate over the Axes objects of subplots I've generated so far.

def __len__(self):

My length is the number of subplots I've generated so far.

def __getitem__(self, k):

Returns the Axes object for my subplot with index k, or the current one if k is None.

def set_(self, what, name, **kw):

Performs a set_ call on my last-generated subplot, where the first argument what is the suffix to the underlying "set_" method and name is what is being set.

Any keywords to the setter method can be supplied.

Returns the result of the setter method call.

def xBounds(self, ax=None, left=None, right=None):
Undocumented
def yBounds(self, ax=None, Ymax=None, bump=False, zeroBottom=False):

If bump is True or Ymax is a value greater than 95% of the largest y-value currently plotted, increases the upper bound by 20%. If zeroBottom is set True, anchors the bottom to zero.

def twinx(self, ax=None):

Creates and returns a twin of the last (or supplied) axes object.

Maintains a list of the twinned axes in the order they were created along with an index of the latest-created twin (for axes re-use).

TODO: Not yet supported!

def getTwins(self, ax=None, mplRoster=False):

Returns a list of the twins for the last (or supplied) axes object, starting with the axes object itself and then the twins in the order they were created.

TODO: Twinned axes are not yet supported! Always returns a single-element list.

def setTicks(self, ticksDict, ax=None):

Call with a dict defining ticks for 'x' and 'y' axes. Each axis has a sub-dict that may include 'major' and 'minor' entries.

Each entry, if present, defines the tick intervals. It can have one of four forms:

  1. An int for a max number of tick intervals.
  2. A float for spacing between intervals.
  3. A Bool, just True or False to enable or disable ticks. (Major ticks are always enabled.)
  4. A 2-sequence of floats containing (1) the spacing between intervals and (2) an anchor point that must have a tick, i.e., the starting point of intervals with ticks below and above it.
def kFix(self, k=None):

If subplot index k is None, returns the index of the current subplot, or the first one if there is not yet a current one.

Does not actually adjust kLast, just the returned value.

Returns the (possibly) fixed subplot index.

TODO: Fix this for use outside just the internal methods below.

def onTop(self, k=None):

Returns True if the current subplot (or one specified with a subplot index k) will appear at the top of a column of subplots.

If there is just one subplot or one row of subplots, of course this will return True.

def atBottom(self, k=None):

Returns True if the current subplot (or one specified with a subplot index k) will appear at the bottom of a column of subplots.

If there is just one subplot or one row of subplots, of course this will return True.

def onLeft(self, k=None):

Returns True if the current subplot (or one specified with a subplot index k) will appear in the leftmost column of subplots.

If there is just one subplot or one column of subplots, of course this will return True.

API Documentation for yampex, generated by pydoctor at 2022-11-21 15:03:54.