MCPcopy
hub / github.com/matplotlib/matplotlib / convert_xunits

Method convert_xunits

lib/matplotlib/artist.py:277–287  ·  view source on GitHub ↗

Convert *x* using the unit type of the xaxis. If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.

(self, x)

Source from the content-addressed store, hash-verified

275 return ax and any(axis.have_units() for axis in ax._axis_map.values())
276
277 def convert_xunits(self, x):
278 """
279 Convert *x* using the unit type of the xaxis.
280
281 If the artist is not contained in an Axes or if the xaxis does not
282 have units, *x* itself is returned.
283 """
284 ax = getattr(self, 'axes', None)
285 if ax is None or ax.xaxis is None:
286 return x
287 return ax.xaxis.convert_units(x)
288
289 def convert_yunits(self, y):
290 """

Callers 15

drawMethod · 0.80
get_unitless_positionMethod · 0.80
_get_xyMethod · 0.80
_recompute_transformMethod · 0.80
recacheMethod · 0.80
_convert_xy_unitsMethod · 0.80
_convert_unitsMethod · 0.80
_recompute_transformMethod · 0.80
_theta_stretchMethod · 0.80
_prepare_pointsMethod · 0.80
set_offsetsMethod · 0.80

Calls 1

convert_unitsMethod · 0.80

Tested by

no test coverage detected