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

Method _get_aspect_ratio

lib/matplotlib/axes/_axes.py:9308–9316  ·  view source on GitHub ↗

Convenience method to calculate the aspect ratio of the Axes in the display coordinate system.

(self)

Source from the content-addressed store, hash-verified

9306 triplot = _make_axes_method(mtri.triplot)
9307
9308 def _get_aspect_ratio(self):
9309 """
9310 Convenience method to calculate the aspect ratio of the Axes in
9311 the display coordinate system.
9312 """
9313 figure_size = self.get_figure().get_size_inches()
9314 ll, ur = self.get_position() * figure_size
9315 width, height = ur - ll
9316 return height / (width * self.get_data_ratio())

Callers 2

Calls 4

get_size_inchesMethod · 0.80
get_figureMethod · 0.45
get_positionMethod · 0.45
get_data_ratioMethod · 0.45

Tested by

no test coverage detected