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

Method append_axes

lib/mpl_toolkits/axes_grid1/axes_divider.py:419–451  ·  view source on GitHub ↗

Add a new axes on a given side of the main axes. Parameters ---------- position : {"left", "right", "bottom", "top"} Where the new axes is positioned relative to the main axes. size : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str

(self, position, size, pad=None, *, axes_class=None,
                    **kwargs)

Source from the content-addressed store, hash-verified

417 return ax
418
419 def append_axes(self, position, size, pad=None, *, axes_class=None,
420 **kwargs):
421 """
422 Add a new axes on a given side of the main axes.
423
424 Parameters
425 ----------
426 position : {"left", "right", "bottom", "top"}
427 Where the new axes is positioned relative to the main axes.
428 size : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
429 The axes width or height. float or str arguments are interpreted
430 as ``axes_size.from_any(size, AxesX(<main_axes>))`` for left or
431 right axes, and likewise with ``AxesY`` for bottom or top axes.
432 pad : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
433 Padding between the axes. float or str arguments are interpreted
434 as for *size*. Defaults to :rc:`figure.subplot.wspace` times the
435 main Axes width (left or right axes) or :rc:`figure.subplot.hspace`
436 times the main Axes height (bottom or top axes).
437 axes_class : subclass type of `~.axes.Axes`, optional
438 The type of the new axes. Defaults to the type of the main axes.
439 **kwargs
440 All extra keywords arguments are passed to the created axes.
441 """
442 create_axes, pack_start = _api.getitem_checked({
443 "left": (self.new_horizontal, True),
444 "right": (self.new_horizontal, False),
445 "bottom": (self.new_vertical, True),
446 "top": (self.new_vertical, False),
447 }, position=position)
448 ax = create_axes(
449 size, pad, pack_start=pack_start, axes_class=axes_class, **kwargs)
450 self._fig.add_axes(ax)
451 return ax
452
453 def get_aspect(self):
454 if self._aspect is None:

Calls 1

add_axesMethod · 0.80

Tested by 2

test_divider_append_axesFunction · 0.64