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')
| 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 | """ |