|
18 | 18 | ``ax`` is a :class:`~matplotlib.axes.Axes` instance, and ``fig`` is a |
19 | 19 | :class:`~matplotlib.figure.Figure` instance. |
20 | 20 |
|
21 | | -+----------------+-----------------------------+-----------------------------------+ |
22 | | -|Coordinates |Transformation object |Description | |
23 | | -+================+=============================+===================================+ |
24 | | -|"data" |``ax.transData`` |The coordinate system for the data,| |
25 | | -| | |controlled by xlim and ylim. | |
26 | | -+----------------+-----------------------------+-----------------------------------+ |
27 | | -|"axes" |``ax.transAxes`` |The coordinate system of the | |
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" |``subfigure.transSubfigure`` |The coordinate system of the | |
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" |``fig.transFigure`` |The coordinate system of the | |
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" |``fig.dpi_scale_trans`` |The coordinate system of the | |
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 | | -|"display" |``None``, or |The pixel coordinate system of the | |
51 | | -| |``IdentityTransform()`` |display window; (0, 0) is bottom | |
52 | | -| | |left of the window, and (width, | |
53 | | -| | |height) is top right of the | |
54 | | -| | |display window in pixels. | |
55 | | -+----------------+-----------------------------+-----------------------------------+ |
56 | | -|"xaxis", |``ax.get_xaxis_transform()``,|Blended coordinate systems; use | |
57 | | -|"yaxis" |``ax.get_yaxis_transform()`` |data coordinates on one of the axis| |
58 | | -| | |and axes coordinates on the other. | |
59 | | -+----------------+-----------------------------+-----------------------------------+ |
| 21 | ++----------------+-----------------------------------+-----------------------------+ |
| 22 | +|Coordinate |Description |Transformation object | |
| 23 | +|system | |from system to display | |
| 24 | ++================+===================================+=============================+ |
| 25 | +|"data" |The coordinate system for the data,|``ax.transData`` | |
| 26 | +| |controlled by xlim and ylim. | | |
| 27 | ++----------------+-----------------------------------+-----------------------------+ |
| 28 | +|"axes" |The coordinate system of the |``ax.transAxes`` | |
| 29 | +| |`~matplotlib.axes.Axes`; (0, 0) | | |
| 30 | +| |is bottom left of the axes, and | | |
| 31 | +| |(1, 1) is top right of the axes. | | |
| 32 | ++----------------+-----------------------------------+-----------------------------+ |
| 33 | +|"subfigure" |The coordinate system of the |``subfigure.transSubfigure`` | |
| 34 | +| |`.SubFigure`; (0, 0) is bottom left| | |
| 35 | +| |of the subfigure, and (1, 1) is top| | |
| 36 | +| |right of the subfigure. If a | | |
| 37 | +| |figure has no subfigures, this is | | |
| 38 | +| |the same as ``transFigure``. | | |
| 39 | ++----------------+-----------------------------------+-----------------------------+ |
| 40 | +|"figure" |The coordinate system of the |``fig.transFigure`` | |
| 41 | +| |`.Figure`; (0, 0) is bottom left | | |
| 42 | +| |of the figure, and (1, 1) is top | | |
| 43 | +| |right of the figure. | | |
| 44 | ++----------------+-----------------------------------+-----------------------------+ |
| 45 | +|"figure-inches" |The coordinate system of the |``fig.dpi_scale_trans`` | |
| 46 | +| |`.Figure` in inches; (0, 0) is | | |
| 47 | +| |bottom left of the figure, and | | |
| 48 | +| |(width, height) is the top right | | |
| 49 | +| |of the figure in inches. | | |
| 50 | ++----------------+-----------------------------------+-----------------------------+ |
| 51 | +|"xaxis", |Blended coordinate systems; use |``ax.get_xaxis_transform()``,| |
| 52 | +|"yaxis" |data coordinates on one of the axis|``ax.get_yaxis_transform()`` | |
| 53 | +| |and axes coordinates on the other. | | |
| 54 | ++----------------+-----------------------------------+-----------------------------+ |
| 55 | +|"display" |The native coordinate system of the|``None``, or | |
| 56 | +| |output ; (0, 0) is the bottom left |``IdentityTransform()`` | |
| 57 | +| |of the window, and (width, height) | | |
| 58 | +| |is top right of the output in | | |
| 59 | +| |"display units". | | |
| 60 | +| | | | |
| 61 | +| |The exact interpertation of the | | |
| 62 | +| |units depends on the back end. For | | |
| 63 | +| |example it is pixels for Agg and | | |
| 64 | +| |pts for svg/pdf. | | |
| 65 | ++----------------+-----------------------------------+-----------------------------+ |
| 66 | +
|
| 67 | +
|
| 68 | +
|
| 69 | +
|
| 70 | +
|
| 71 | +
|
60 | 72 |
|
61 | 73 | All of the transformation objects in the table above take inputs in |
62 | 74 | their coordinate system, and transform the input to the *display* |
|
89 | 101 | :meth:`~matplotlib.axes.Axes.set_ylim` methods. For example, in the figure |
90 | 102 | below, the data limits stretch from 0 to 10 on the x-axis, and -1 to 1 on the |
91 | 103 | y-axis. |
| 104 | +
|
92 | 105 | """ |
93 | 106 |
|
94 | 107 | import numpy as np |
|
0 commit comments