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

Method get_data_ratio

lib/matplotlib/axes/_base.py:1951–1963  ·  view source on GitHub ↗

Return the aspect ratio of the scaled data. Notes ----- This method is intended to be overridden by new projection types.

(self)

Source from the content-addressed store, hash-verified

1949 self.stale = True
1950
1951 def get_data_ratio(self):
1952 """
1953 Return the aspect ratio of the scaled data.
1954
1955 Notes
1956 -----
1957 This method is intended to be overridden by new projection types.
1958 """
1959 txmin, txmax = self.xaxis.get_transform().transform(self.get_xbound())
1960 tymin, tymax = self.yaxis.get_transform().transform(self.get_ybound())
1961 xsize = max(abs(txmax - txmin), 1e-30)
1962 ysize = max(abs(tymax - tymin), 1e-30)
1963 return ysize / xsize
1964
1965 def apply_aspect(self, position=None):
1966 """

Callers 2

apply_aspectMethod · 0.95
_get_aspect_ratioMethod · 0.45

Calls 4

get_xboundMethod · 0.95
get_yboundMethod · 0.95
transformMethod · 0.45
get_transformMethod · 0.45

Tested by

no test coverage detected