Repository: matplotlib/matplotlib
File: galleries/users_explain/artists/transforms_tutorial.py (Python)

Code before:
#
# and we can use this same inverted transformation to go from the unit
# *axes* coordinates back to *data* coordinates.
#
# .. sourcecode:: ipython
#
#     In [90]: inv.transform((0.25, 0.25))
#     Out[90]: array([ 2.5, -0.5])
#
# The final piece is the ``self.transScale`` attribute, which is
# responsible for the optional non-linear scaling of the data, e.g., for
# logarithmic axes.  When an Axes is initially setup, this is just set to
# the identity transform, since the basic Matplotlib axes has linear
# scale, but when you call a logarithmic scaling function like
# :meth:`~matplotlib.axes.Axes.semilogx` or explicitly set the scale to
# logarithmic with :meth:`~matplotlib.axes.Axes.set_xscale`, then the
# ``ax.transScale`` attribute is set to handle the nonlinear projection.
# The scales transforms are properties of the respective ``xaxis`` and
# ``yaxis`` :class:`~matplotlib.axis.Axis` instances.  For example, when
# you call ``ax.set_xscale('log')``, the xaxis updates its scale to a
# :class:`matplotlib.scale.LogScale` instance.
#
# For non-separable axes, such as PolarAxes, there are some more pieces to
# consider, in particular the projection transformation.  The ``transData`` of
# `matplotlib.projections.polar.PolarAxes` is similar to that of
# the typical separable Axes, but includes some additional pieces::
#
#        self.transData = (
#            self.transScale + self.transShift + self.transProjection +
#            (self.transProjectionAffine + self.transWedge + self.transAxes))
#
# ``transProjection`` handles the projection from data coordinates
# (e.g., latitude and longitude for map data, or radius and theta for polar
# data), to a separable Cartesian coordinate system.  There are several
# projection examples in the :mod:`matplotlib.projections` package, and the
# best way to learn more is to open the source for those packages and
# see how to make your own, since Matplotlib supports extensible axes
# and projections.  Michael Droettboom has provided a nice tutorial
# example of creating a Hammer projection axes; see
# :doc:`/gallery/misc/custom_projection`.


Review comment (suggestion):
```suggestion
# For non-separable axes, there are some more pieces to
# consider, in particular the projection transformation.  For example, the ``transData`` of
# `matplotlib.projections.polar.PolarAxes` includes ::
```
trying to remove some of the overlap

Code after:
#
# and we can use this same inverted transformation to go from the unit
# *axes* coordinates back to *data* coordinates.
#
# .. sourcecode:: ipython
#
#     In [90]: inv.transform((0.25, 0.25))
#     Out[90]: array([ 2.5, -0.5])
#
# The final piece is the ``self.transScale`` attribute, which is
# responsible for the optional non-linear scaling of the data, e.g., for
# logarithmic axes.  When an Axes is initially setup, this is just set to
# the identity transform, since the basic Matplotlib axes has linear
# scale, but when you call a logarithmic scaling function like
# :meth:`~matplotlib.axes.Axes.semilogx` or explicitly set the scale to
# logarithmic with :meth:`~matplotlib.axes.Axes.set_xscale`, then the
# ``ax.transScale`` attribute is set to handle the nonlinear projection.
# The scales transforms are properties of the respective ``xaxis`` and
# ``yaxis`` :class:`~matplotlib.axis.Axis` instances.  For example, when
# you call ``ax.set_xscale('log')``, the xaxis updates its scale to a
# :class:`matplotlib.scale.LogScale` instance.
#
# For non-separable axes, there are some more pieces to consider, in
# particular the projection transformation.  For example, the ``transData``
# of `matplotlib.projections.polar.PolarAxes` is more complex than that of a
# typical separable Axes::
#
#     self.transData = (
#         self.transScale + self.transShift + self.transProjection +
#         (self.transProjectionAffine + self.transWedge + self.transAxes))
#
# ``transProjection`` handles the projection from data coordinates
# (e.g., latitude and longitude for map data, or radius and theta for polar
# data), to a separable Cartesian coordinate system.  There are several
# projection examples in the :mod:`matplotlib.projections` package, and the
# best way to learn more is to open the source for those packages and
# see how to make your own, since Matplotlib supports extensible axes
# and projections.  Michael Droettboom has provided a nice tutorial
# example of creating a Hammer projection axes; see
# :doc:`/gallery/misc/custom_projection`.