MCPcopy
hub / github.com/matplotlib/matplotlib / apply_aspect

Method apply_aspect

lib/mpl_toolkits/mplot3d/axes3d.py:438–453  ·  view source on GitHub ↗
(self, position=None)

Source from the content-addressed store, hash-verified

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):

Callers 2

drawMethod · 0.95
drawMethod · 0.45

Calls 9

unitMethod · 0.80
shrunk_to_aspectMethod · 0.80
_set_positionMethod · 0.80
anchoredMethod · 0.80
get_positionMethod · 0.45
get_figureMethod · 0.45
transformedMethod · 0.45
frozenMethod · 0.45
get_anchorMethod · 0.45

Tested by

no test coverage detected