|
14 | 14 | generation, it helps to have an understanding of these objects so you
|
15 | 15 | can reuse the existing transformations matplotlib makes available to
|
16 | 16 | 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 |
18 | 18 | object you should use to work in that coordinate system, and the
|
19 | 19 | description of that system. In the `Transformation Object` column,
|
20 | 20 | ``ax`` is a :class:`~matplotlib.axes.Axes` instance, and ``fig`` is a
|
21 | 21 | :class:`~matplotlib.figure.Figure` instance.
|
22 | 22 |
|
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 | +=========== ============================= ===================================== |
37 | 44 |
|
38 | 45 | All of the transformation objects in the table above take inputs in
|
39 | 46 | their coordinate system, and transform the input to the `display`
|
|
457 | 464 | # best way to learn more is to open the source for those packages and
|
458 | 465 | # see how to make your own, since matplotlib supports extensible axes
|
459 | 466 | # 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 |
461 | 468 | # :ref:`sphx_glr_gallery_api_custom_projection_example.py`.
|
0 commit comments