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

Skip to content

Commit a668754

Browse files
authored
Merge pull request #24756 from QuLogic/simpler-tables
DOC: Simplify some table markup
2 parents afa8633 + 1ea9244 commit a668754

File tree

7 files changed

+83
-74
lines changed

7 files changed

+83
-74
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5826,9 +5826,9 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
58265826
The coordinates of the corners of quadrilaterals of a pcolormesh::
58275827
58285828
(X[i+1, j], Y[i+1, j]) (X[i+1, j+1], Y[i+1, j+1])
5829-
+-----+
5830-
| |
5831-
+-----+
5829+
●╶───╴●
5830+
5831+
●╶───╴●
58325832
(X[i, j], Y[i, j]) (X[i, j+1], Y[i, j+1])
58335833
58345834
Note that the column index corresponds to the x-coordinate, and
@@ -6068,9 +6068,9 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
60686068
The coordinates of the corners of quadrilaterals of a pcolormesh::
60696069
60706070
(X[i+1, j], Y[i+1, j]) (X[i+1, j+1], Y[i+1, j+1])
6071-
+-----+
6072-
| |
6073-
+-----+
6071+
●╶───╴●
6072+
6073+
●╶───╴●
60746074
(X[i, j], Y[i, j]) (X[i, j+1], Y[i, j+1])
60756075
60766076
Note that the column index corresponds to the x-coordinate, and

lib/matplotlib/axes/_base.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,17 +1892,15 @@ def set_anchor(self, anchor, share=False):
18921892
Either an (*x*, *y*) pair of relative coordinates (0 is left or
18931893
bottom, 1 is right or top), 'C' (center), or a cardinal direction
18941894
('SW', southwest, is bottom left, etc.). str inputs are shorthands
1895-
for (*x*, *y*) coordinates, as shown in the following table::
1896-
1897-
.. code-block:: none
1898-
1899-
+-----------------+-----------------+-----------------+
1900-
| 'NW' (0.0, 1.0) | 'N' (0.5, 1.0) | 'NE' (1.0, 1.0) |
1901-
+-----------------+-----------------+-----------------+
1902-
| 'W' (0.0, 0.5) | 'C' (0.5, 0.5) | 'E' (1.0, 0.5) |
1903-
+-----------------+-----------------+-----------------+
1904-
| 'SW' (0.0, 0.0) | 'S' (0.5, 0.0) | 'SE' (1.0, 0.0) |
1905-
+-----------------+-----------------+-----------------+
1895+
for (*x*, *y*) coordinates, as shown in the following diagram::
1896+
1897+
┌─────────────────┬─────────────────┬─────────────────┐
1898+
│ 'NW' (0.0, 1.0) │ 'N' (0.5, 1.0) │ 'NE' (1.0, 1.0) │
1899+
├─────────────────┼─────────────────┼─────────────────┤
1900+
│ 'W' (0.0, 0.5) │ 'C' (0.5, 0.5) │ 'E' (1.0, 0.5) │
1901+
├─────────────────┼─────────────────┼─────────────────┤
1902+
│ 'SW' (0.0, 0.0) │ 'S' (0.5, 0.0) │ 'SE' (1.0, 0.0) │
1903+
└─────────────────┴─────────────────┴─────────────────┘
19061904
19071905
share : bool, default: False
19081906
If ``True``, apply the settings to all shared Axes.

lib/matplotlib/quiver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@
150150
================= ================= ==================
151151
units zoom figure size change
152152
================= ================= ==================
153-
'x', 'y', 'xy' arrow size scales -
154-
'width', 'height' - arrow size scales
155-
'dots', 'inches' - -
153+
'x', 'y', 'xy' arrow size scales
154+
'width', 'height' arrow size scales
155+
'dots', 'inches'
156156
================= ================= ==================
157157
158158
width : float, optional

lib/matplotlib/style/core.py

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -91,27 +91,31 @@ def use(style):
9191
----------
9292
style : str, dict, Path or list
9393
94-
A style specification.
94+
A style specification. Valid options are:
9595
96-
- If a str, this can be one of the style names in `.style.available`
97-
(a builtin style or a style installed in the user library path).
96+
str
97+
- One of the style names in `.style.available` (a builtin style or
98+
a style installed in the user library path).
9899
99-
This can also be a dotted name of the form "package.style_name"; in
100-
that case, "package" should be an importable Python package name,
101-
e.g. at ``/path/to/package/__init__.py``; the loaded style file is
102-
``/path/to/package/style_name.mplstyle``. (Style files in
103-
subpackages are likewise supported.)
100+
- A dotted name of the form "package.style_name"; in that case,
101+
"package" should be an importable Python package name, e.g. at
102+
``/path/to/package/__init__.py``; the loaded style file is
103+
``/path/to/package/style_name.mplstyle``. (Style files in
104+
subpackages are likewise supported.)
104105
105-
This can also be the path or URL to a style file, which gets loaded
106-
by `.rc_params_from_file`.
106+
- The path or URL to a style file, which gets loaded by
107+
`.rc_params_from_file`.
107108
108-
- If a dict, this is a mapping of key/value pairs for `.rcParams`.
109+
dict
110+
A mapping of key/value pairs for `matplotlib.rcParams`.
109111
110-
- If a Path, this is the path to a style file, which gets loaded by
111-
`.rc_params_from_file`.
112+
Path
113+
The path to a style file, which gets loaded by
114+
`.rc_params_from_file`.
112115
113-
- If a list, this is a list of style specifiers (str, Path or dict),
114-
which get applied from first to last in the list.
116+
list
117+
A list of style specifiers (str, Path or dict), which are applied
118+
from first to last in the list.
115119
116120
Notes
117121
-----
@@ -186,18 +190,28 @@ def context(style, after_reset=False):
186190
style : str, dict, Path or list
187191
A style specification. Valid options are:
188192
189-
+------+-------------------------------------------------------------+
190-
| str | The name of a style or a path/URL to a style file. For a |
191-
| | list of available style names, see `.style.available`. |
192-
+------+-------------------------------------------------------------+
193-
| dict | Dictionary with valid key/value pairs for |
194-
| | `matplotlib.rcParams`. |
195-
+------+-------------------------------------------------------------+
196-
| Path | A path-like object which is a path to a style file. |
197-
+------+-------------------------------------------------------------+
198-
| list | A list of style specifiers (str, Path or dict) applied from |
199-
| | first to last in the list. |
200-
+------+-------------------------------------------------------------+
193+
str
194+
- One of the style names in `.style.available` (a builtin style or
195+
a style installed in the user library path).
196+
197+
- A dotted name of the form "package.style_name"; in that case,
198+
"package" should be an importable Python package name, e.g. at
199+
``/path/to/package/__init__.py``; the loaded style file is
200+
``/path/to/package/style_name.mplstyle``. (Style files in
201+
subpackages are likewise supported.)
202+
203+
- The path or URL to a style file, which gets loaded by
204+
`.rc_params_from_file`.
205+
dict
206+
A mapping of key/value pairs for `matplotlib.rcParams`.
207+
208+
Path
209+
The path to a style file, which gets loaded by
210+
`.rc_params_from_file`.
211+
212+
list
213+
A list of style specifiers (str, Path or dict), which are applied
214+
from first to last in the list.
201215
202216
after_reset : bool
203217
If True, apply style after resetting settings to their defaults;

lib/matplotlib/ticker.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,17 +1520,14 @@ def format_pct(self, x, display_range):
15201520
decimal point is set based on the *display_range* of the axis
15211521
as follows:
15221522
1523-
+---------------+----------+------------------------+
1524-
| display_range | decimals | sample |
1525-
+---------------+----------+------------------------+
1526-
| >50 | 0 | ``x = 34.5`` => 35% |
1527-
+---------------+----------+------------------------+
1528-
| >5 | 1 | ``x = 34.5`` => 34.5% |
1529-
+---------------+----------+------------------------+
1530-
| >0.5 | 2 | ``x = 34.5`` => 34.50% |
1531-
+---------------+----------+------------------------+
1532-
| ... | ... | ... |
1533-
+---------------+----------+------------------------+
1523+
============= ======== =======================
1524+
display_range decimals sample
1525+
============= ======== =======================
1526+
>50 0 ``x = 34.5`` => 35%
1527+
>5 1 ``x = 34.5`` => 34.5%
1528+
>0.5 2 ``x = 34.5`` => 34.50%
1529+
... ... ...
1530+
============= ======== =======================
15341531
15351532
This method will not be very good for tiny axis ranges or
15361533
extremely large ones. It assumes that the values on the chart

lib/mpl_toolkits/axes_grid1/axes_rgb.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ class RGBAxes:
6161
"""
6262
4-panel `~.Axes.imshow` (RGB, R, G, B).
6363
64-
Layout:
65-
66-
+---------------+-----+
67-
| | R |
68-
+ +-----+
69-
| RGB | G |
70-
+ +-----+
71-
| | B |
72-
+---------------+-----+
64+
Layout::
65+
66+
┌───────────────┬─────┐
67+
R
68+
├─────┤
69+
RGB G
70+
├─────┤
71+
B
72+
└───────────────┴─────┘
7373
7474
Subclasses can override the ``_defaultAxesClass`` attribute.
7575
By default RGBAxes uses `.mpl_axes.Axes`.

tutorials/toolkits/axes_grid.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,13 @@
268268
269269
.. code-block:: none
270270
271-
+--------+--------+--------+--------+
272-
| (2, 0) | (2, 1) | (2, 2) | (2, 3) |
273-
+--------+--------+--------+--------+
274-
| (1, 0) | (1, 1) | (1, 2) | (1, 3) |
275-
+--------+--------+--------+--------+
276-
| (0, 0) | (0, 1) | (0, 2) | (0, 3) |
277-
+--------+--------+--------+--------+
271+
┌────────┬────────┬────────┬────────┐
272+
(2, 0) (2, 1) (2, 2) (2, 3)
273+
├────────┼────────┼────────┼────────┤
274+
(1, 0) (1, 1) (1, 2) (1, 3)
275+
├────────┼────────┼────────┼────────┤
276+
(0, 0) (0, 1) (0, 2) (0, 3)
277+
└────────┴────────┴────────┴────────┘
278278
279279
such that the bottom row has a fixed height of 2 (inches) and the top two rows
280280
have a height ratio of 2 (middle) to 3 (top). (For example, if the grid has

0 commit comments

Comments
 (0)