(self, position=None)
| 436 | self.stale = True |
| 437 | |
| 438 | def apply_aspect(self, position=None): |
| 439 | if position is None: |
| 440 | position = self.get_position(original=True) |
| 441 | |
| 442 | # in the superclass, we would go through and actually deal with axis |
| 443 | # scales and box/datalim. Those are all irrelevant - all we need to do |
| 444 | # is make sure our coordinate system is square. |
| 445 | trans = self.get_figure().transSubfigure |
| 446 | bb = mtransforms.Bbox.unit().transformed(trans) |
| 447 | # this is the physical aspect of the panel (or figure): |
| 448 | fig_aspect = bb.height / bb.width |
| 449 | |
| 450 | box_aspect = 1 |
| 451 | pb = position.frozen() |
| 452 | pb1 = pb.shrunk_to_aspect(box_aspect, pb, fig_aspect) |
| 453 | self._set_position(pb1.anchored(self.get_anchor(), pb), 'active') |
| 454 | |
| 455 | @martist.allow_rasterization |
| 456 | def draw(self, renderer): |
no test coverage detected