Skip to content

Commit 8d8a3fc

Browse files
committed
Document get_{x,y}axis_transform more prominently.
They are quite useful but right now are documented in a slightly obscure manner.
1 parent ad730d1 commit 8d8a3fc

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

tutorials/advanced/transforms_tutorial.py

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,33 @@
1414
generation, it helps to have an understanding of these objects so you
1515
can reuse the existing transformations matplotlib makes available to
1616
you, or create your own (see :mod:`matplotlib.transforms`). The table
17-
below summarizes the existing coordinate systems, the transformation
17+
below summarizes the some useful coordinate systems, the transformation
1818
object you should use to work in that coordinate system, and the
1919
description of that system. In the `Transformation Object` column,
2020
``ax`` is a :class:`~matplotlib.axes.Axes` instance, and ``fig`` is a
2121
:class:`~matplotlib.figure.Figure` instance.
2222
23-
========== ===================== ====================================================================================
24-
Coordinate Transformation Object Description
25-
========== ===================== ====================================================================================
26-
`data` ``ax.transData`` The userland data coordinate system, controlled by the xlim and ylim
27-
`axes` ``ax.transAxes`` The coordinate system of the :class:`~matplotlib.axes.Axes`; (0, 0) is
28-
bottom left of the axes, and (1, 1) is top right of the axes.
29-
`figure` ``fig.transFigure`` The coordinate system of the :class:`~matplotlib.figure.Figure`; (0, 0)
30-
is bottom left of the figure, and (1, 1) is top right of the figure.
31-
`display` `None` This is the pixel coordinate system of the display; (0, 0) is the bottom
32-
left of the display, and (width, height) is the top right of the display in pixels.
33-
Alternatively, the identity transform
34-
(:class:`matplotlib.transforms.IdentityTransform()`) may be used instead of None.
35-
========== ===================== ====================================================================================
36-
23+
=========== ============================= =====================================
24+
Coordinates Transformation object Description
25+
=========== ============================= =====================================
26+
"data" ``ax.transData```` The coordinate system for the data,
27+
controlled by xlim and ylim.
28+
"axes" ``ax.transAxes`` The coordinate system of the
29+
`~.Axes`; (0, 0) is bottom left of
30+
the axes, and (1, 1) is top right of
31+
the axes.
32+
"figure" ``fig.transFigure`` The coordinate system of the
33+
`~.Figure`; (0, 0) is bottom left of
34+
the figure, and (1, 1) is top right
35+
of the figure.
36+
"display" ``None``, or The pixel coordinate system of the
37+
``IdentityTransform()`` display; (0, 0) is bottom left of the
38+
display, and (width, height) is top
39+
right of the display in pixels.
40+
"xaxis", ``ax.get_xaxis_transform()``, Blended coordinate systems; use data
41+
"yaxis" ``ax.get_yaxis_transform()`` coordinates on one of the axis and
42+
axes coordinates on the other.
43+
=========== ============================= =====================================
3744
3845
All of the transformation objects in the table above take inputs in
3946
their coordinate system, and transform the input to the `display`
@@ -457,5 +464,5 @@
457464
# best way to learn more is to open the source for those packages and
458465
# see how to make your own, since matplotlib supports extensible axes
459466
# and projections. Michael Droettboom has provided a nice tutorial
460-
# example of creating a hammer projection axes; see
467+
# example of creating a Hammer projection axes; see
461468
# :ref:`sphx_glr_gallery_api_custom_projection_example.py`.

0 commit comments

Comments
 (0)