A `.SubplotDivider` for laying out axes vertically, while ensuring that they have equal widths.
| 555 | |
| 556 | |
| 557 | class 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 | |
| 594 | def make_axes_locatable(axes): |
no outgoing calls
searching dependent graphs…