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

Class VBoxDivider

lib/mpl_toolkits/axes_grid1/axes_divider.py:557–591  ·  view source on GitHub ↗

A `.SubplotDivider` for laying out axes vertically, while ensuring that they have equal widths.

Source from the content-addressed store, hash-verified

555
556
557class VBoxDivider(SubplotDivider):
558 """
559 A `.SubplotDivider` for laying out axes vertically, while ensuring that
560 they have equal widths.
561 """
562
563 def new_locator(self, ny, ny1=None):
564 """
565 Create an axes locator callable for the specified cell.
566
567 Parameters
568 ----------
569 ny, ny1 : int
570 Integers specifying the row-position of the
571 cell. When *ny1* is None, a single *ny*-th row is
572 specified. Otherwise, location of rows spanning between *ny*
573 to *ny1* (but excluding *ny1*-th row) is specified.
574 """
575 return super().new_locator(0, ny, 0, ny1)
576
577 def _locate(self, nx, ny, nx1, ny1, axes, renderer):
578 # docstring inherited
579 ny += self._yrefindex
580 ny1 += self._yrefindex
581 fig_w, fig_h = self._fig.bbox.size / self._fig.dpi
582 x, y, w, h = self.get_position_runtime(axes, renderer)
583 summed_hs = self.get_vertical_sizes(renderer)
584 equal_ws = self.get_horizontal_sizes(renderer)
585 y0, x0, oy, ww = _locate(
586 y, x, h, w, summed_hs, equal_ws, fig_h, fig_w, self.get_anchor())
587 if ny1 is None:
588 ny1 = -1
589 x1, w1 = x0, ww
590 y1, h1 = y0 + oy[ny] / fig_h, (oy[ny1] - oy[ny]) / fig_h
591 return mtransforms.Bbox.from_bounds(x1, y1, w1, h1)
592
593
594def make_axes_locatable(axes):

Callers 2

test_vbox_dividerFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_vbox_dividerFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…