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

Method _set_lim_and_transforms

lib/matplotlib/axes/_base.py:935–969  ·  view source on GitHub ↗

Set the *_xaxis_transform*, *_yaxis_transform*, *transScale*, *transData*, *transLimits* and *transAxes* transformations. .. note:: This method is primarily used by rectilinear projections of the `~matplotlib.axes.Axes` class, and is meant to be ove

(self)

Source from the content-addressed store, hash-verified

933 self._tight = tight
934
935 def _set_lim_and_transforms(self):
936 """
937 Set the *_xaxis_transform*, *_yaxis_transform*, *transScale*,
938 *transData*, *transLimits* and *transAxes* transformations.
939
940 .. note::
941
942 This method is primarily used by rectilinear projections of the
943 `~matplotlib.axes.Axes` class, and is meant to be overridden by
944 new kinds of projection Axes that need different transformations
945 and limits. (See `~matplotlib.projections.polar.PolarAxes` for an
946 example.)
947 """
948 self.transAxes = mtransforms.BboxTransformTo(self.bbox)
949
950 # Transforms the x and y axis separately by a scale factor.
951 # It is assumed that this part will have non-linear components
952 # (e.g., for a log scale).
953 self.transScale = mtransforms.TransformWrapper(
954 mtransforms.IdentityTransform())
955
956 # An affine transformation on the data, generally to limit the
957 # range of the axes
958 self.transLimits = mtransforms.BboxTransformFrom(
959 mtransforms.TransformedBbox(self._viewLim, self.transScale))
960
961 # The parentheses are important for efficiency here -- they
962 # group the last two (which are usually affines) separately
963 # from the first (which, with log-scaling can be non-affine).
964 self.transData = self.transScale + (self.transLimits + self.transAxes)
965
966 self._xaxis_transform = mtransforms.blended_transform_factory(
967 self.transData, self.transAxes)
968 self._yaxis_transform = mtransforms.blended_transform_factory(
969 self.transAxes, self.transData)
970
971 def get_xaxis_transform(self, which='grid'):
972 """

Callers 1

set_figureMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected