Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 05b5049

Browse files
committed
DOC: fix xrefs + defined subfigure in prose
1 parent c9af555 commit 05b5049

File tree

1 file changed

+55
-53
lines changed

1 file changed

+55
-53
lines changed

tutorials/advanced/transforms_tutorial.py

Lines changed: 55 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -11,57 +11,59 @@
1111
the limits of custom figure generation, it helps to have an understanding of
1212
these objects so you can reuse the existing transformations Matplotlib makes
1313
available to you, or create your own (see :mod:`matplotlib.transforms`). The
14-
table below summarizes some useful coordinate systems, a description of
15-
each system, and the transformation object for going from each coordinate
16-
system to the *display* coordinates. In the "Transformation Object" column,
17-
``ax`` is a :class:`~matplotlib.axes.Axes` instance, and ``fig`` is a
18-
:class:`~matplotlib.figure.Figure` instance.
19-
20-
+----------------+-----------------------------------+-----------------------------+
21-
|Coordinate |Description |Transformation object |
22-
|system | |from system to display |
23-
+================+===================================+=============================+
24-
|"data" |The coordinate system of the data |``ax.transData`` |
25-
| |in the Axes. | |
26-
+----------------+-----------------------------------+-----------------------------+
27-
|"axes" |The coordinate system of the |``ax.transAxes`` |
28-
| |`~matplotlib.axes.Axes`; (0, 0) | |
29-
| |is bottom left of the axes, and | |
30-
| |(1, 1) is top right of the axes. | |
31-
+----------------+-----------------------------------+-----------------------------+
32-
|"subfigure" |The coordinate system of the |``subfigure.transSubfigure`` |
33-
| |`.SubFigure`; (0, 0) is bottom left| |
34-
| |of the subfigure, and (1, 1) is top| |
35-
| |right of the subfigure. If a | |
36-
| |figure has no subfigures, this is | |
37-
| |the same as ``transFigure``. | |
38-
+----------------+-----------------------------------+-----------------------------+
39-
|"figure" |The coordinate system of the |``fig.transFigure`` |
40-
| |`.Figure`; (0, 0) is bottom left | |
41-
| |of the figure, and (1, 1) is top | |
42-
| |right of the figure. | |
43-
+----------------+-----------------------------------+-----------------------------+
44-
|"figure-inches" |The coordinate system of the |``fig.dpi_scale_trans`` |
45-
| |`.Figure` in inches; (0, 0) is | |
46-
| |bottom left of the figure, and | |
47-
| |(width, height) is the top right | |
48-
| |of the figure in inches. | |
49-
+----------------+-----------------------------------+-----------------------------+
50-
|"xaxis", |Blended coordinate systems, using |``ax.get_xaxis_transform()``,|
51-
|"yaxis" |data coordinates on one direction |``ax.get_yaxis_transform()`` |
52-
| |and axes coordinates on the other. | |
53-
+----------------+-----------------------------------+-----------------------------+
54-
|"display" |The native coordinate system of the|``None``, or |
55-
| |output ; (0, 0) is the bottom left |``IdentityTransform()`` |
56-
| |of the window, and (width, height) | |
57-
| |is top right of the output in | |
58-
| |"display units". | |
59-
| | | |
60-
| |The exact interpertation of the | |
61-
| |units depends on the back end. For | |
62-
| |example it is pixels for Agg and | |
63-
| |points for svg/pdf. | |
64-
+----------------+-----------------------------------+-----------------------------+
14+
table below summarizes some useful coordinate systems, a description of each
15+
system, and the transformation object for going from each coordinate system to
16+
the *display* coordinates. In the "Transformation Object" column, ``ax`` is a
17+
:class:`~matplotlib.axes.Axes` instance, ``fig`` is a
18+
:class:`~matplotlib.figure.Figure` instance, and ``subfigure`` is a
19+
:class:`~matplotlib.figure.SubFigure` instance.
20+
21+
22+
+----------------+-----------------------------------+---------------------------------------------------+
23+
|Coordinate |Description |Transformation object |
24+
|system | |from system to display |
25+
+================+===================================+===================================================+
26+
|"data" |The coordinate system of the data |``ax.transData`` |
27+
| |in the Axes. | |
28+
+----------------+-----------------------------------+---------------------------------------------------+
29+
|"axes" |The coordinate system of the |``ax.transAxes`` |
30+
| |`~matplotlib.axes.Axes`; (0, 0) | |
31+
| |is bottom left of the axes, and | |
32+
| |(1, 1) is top right of the axes. | |
33+
+----------------+-----------------------------------+---------------------------------------------------+
34+
|"subfigure" |The coordinate system of the |``subfigure.transSubfigure`` |
35+
| |`.SubFigure`; (0, 0) is bottom left| |
36+
| |of the subfigure, and (1, 1) is top| |
37+
| |right of the subfigure. If a | |
38+
| |figure has no subfigures, this is | |
39+
| |the same as ``transFigure``. | |
40+
+----------------+-----------------------------------+---------------------------------------------------+
41+
|"figure" |The coordinate system of the |``fig.transFigure`` |
42+
| |`.Figure`; (0, 0) is bottom left | |
43+
| |of the figure, and (1, 1) is top | |
44+
| |right of the figure. | |
45+
+----------------+-----------------------------------+---------------------------------------------------+
46+
|"figure-inches" |The coordinate system of the |``fig.dpi_scale_trans`` |
47+
| |`.Figure` in inches; (0, 0) is | |
48+
| |bottom left of the figure, and | |
49+
| |(width, height) is the top right | |
50+
| |of the figure in inches. | |
51+
+----------------+-----------------------------------+---------------------------------------------------+
52+
|"xaxis", |Blended coordinate systems, using |``ax.get_xaxis_transform()``, |
53+
|"yaxis" |data coordinates on one direction |``ax.get_yaxis_transform()`` |
54+
| |and axes coordinates on the other. | |
55+
+----------------+-----------------------------------+---------------------------------------------------+
56+
|"display" |The native coordinate system of the|`None`, or |
57+
| |output ; (0, 0) is the bottom left |:class:`~matplotlib.transforms.IdentityTransform()`|
58+
| |of the window, and (width, height) | |
59+
| |is top right of the output in | |
60+
| |"display units". | |
61+
| | | |
62+
| |The exact interpertation of the | |
63+
| |units depends on the back end. For | |
64+
| |example it is pixels for Agg and | |
65+
| |points for svg/pdf. | |
66+
+----------------+-----------------------------------+---------------------------------------------------+
6567
6668
6769
@@ -77,10 +79,10 @@
7779
transforms.
7880
7981
The transformations also know how to invert themselves (via
80-
`Transform.inverted`) to generate a transform from output coordinate system
82+
`.Transform.inverted`) to generate a transform from output coordinate system
8183
back to the input coordinate system. For example, ``ax.transData`` converts
8284
values in data coordinates to display coordinates and
83-
``ax.transData.inversed()`` is a :class:``matplotlib.transforms.Transform` that
85+
``ax.transData.inversed()`` is a :class:`matplotlib.transforms.Transform` that
8486
goes from display coordinates to data coordinates. This is particularly useful
8587
when processing events from the user interface, which typically occur in
8688
display space, and you want to know where the mouse click or key-press occurred

0 commit comments

Comments
 (0)