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

Method get_xaxis_transform

lib/matplotlib/axes/_base.py:971–997  ·  view source on GitHub ↗

Get the transformation used for drawing x-axis labels, ticks and gridlines. The x-direction is in data coordinates and the y-direction is in axis coordinates. .. note:: This transformation is primarily used by the `~matplotlib.axis.Axis` cl

(self, which='grid')

Source from the content-addressed store, hash-verified

969 self.transAxes, self.transData)
970
971 def get_xaxis_transform(self, which='grid'):
972 """
973 Get the transformation used for drawing x-axis labels, ticks
974 and gridlines. The x-direction is in data coordinates and the
975 y-direction is in axis coordinates.
976
977 .. note::
978
979 This transformation is primarily used by the
980 `~matplotlib.axis.Axis` class, and is meant to be
981 overridden by new kinds of projections that may need to
982 place axis elements in different locations.
983
984 Parameters
985 ----------
986 which : {'grid', 'tick1', 'tick2'}
987 """
988 if which == 'grid':
989 return self._xaxis_transform
990 elif which == 'tick1':
991 # for cartesian projection, this is bottom spine
992 return self.spines.bottom.get_spine_transform()
993 elif which == 'tick2':
994 # for cartesian projection, this is top spine
995 return self.spines.top.get_spine_transform()
996 else:
997 raise ValueError(f'unknown value for which: {which!r}')
998
999 def get_xaxis_text1_transform(self, pad_points):
1000 """

Callers 15

_update_line_limitsMethod · 0.95
_update_patch_limitsMethod · 0.95
get_tick_transformMethod · 0.45
get_spine_transformMethod · 0.45
__init__Method · 0.45
format_data_shortMethod · 0.45
__init__Method · 0.45
new_axesMethod · 0.45
axvlineMethod · 0.45
axvspanMethod · 0.45

Calls 1

get_spine_transformMethod · 0.80

Tested by 3

test_axis_method_errorsFunction · 0.36