MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / new_vertical

Method new_vertical

lib/mpl_toolkits/axes_grid1/axes_divider.py:394–417  ·  view source on GitHub ↗

Helper method for ``append_axes("top")`` and ``append_axes("bottom")``. See the documentation of `append_axes` for more details. :meta private:

(self, size, pad=None, pack_start=False, **kwargs)

Source from the content-addressed store, hash-verified

392 return ax
393
394 def new_vertical(self, size, pad=None, pack_start=False, **kwargs):
395 """
396 Helper method for ``append_axes("top")`` and ``append_axes("bottom")``.
397
398 See the documentation of `append_axes` for more details.
399
400 :meta private:
401 """
402 if pad is None:
403 pad = mpl.rcParams["figure.subplot.hspace"] * self._yref
404 pos = "bottom" if pack_start else "top"
405 if pad:
406 if not isinstance(pad, Size._Base):
407 pad = Size.from_any(pad, fraction_ref=self._yref)
408 self.append_size(pos, pad)
409 if not isinstance(size, Size._Base):
410 size = Size.from_any(size, fraction_ref=self._yref)
411 self.append_size(pos, size)
412 locator = self.new_locator(
413 nx=self._xrefindex,
414 ny=0 if pack_start else len(self._vertical) - 1)
415 ax = self._get_new_axes(**kwargs)
416 ax.set_axes_locator(locator)
417 return ax
418
419 def append_axes(self, position, size, pad=None, *, axes_class=None,
420 **kwargs):

Callers

nothing calls this directly

Calls 4

_get_new_axesMethod · 0.95
append_sizeMethod · 0.80
new_locatorMethod · 0.45
set_axes_locatorMethod · 0.45

Tested by

no test coverage detected