8000 [Doc]: Add alt-text to images in 3.6 release notes #24844 (#24878) · matplotlib/matplotlib@2f55cd5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2f55cd5

Browse files
hasanrashidQuLogic
andauthored
[Doc]: Add alt-text to images in 3.6 release notes #24844 (#24878)
* alt text is added with .alt. directive * Aligning alt text * Comments resolved after initial review of PR 24878 * Fixing a typo in line 153 * Fixed capitalization and accidental extra alt: after plot * Fixed blank line before :include-source directive * Removing trailing whitespace in 152 * Fixed indentation and type * Blank line before directive * Removing trailing whitespace in 152 Fixed indentation and type Blank line before directive * Update doc/users/prev_whats_new/whats_new_3.6.0.rst Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> * Update doc/users/prev_whats_new/whats_new_3.6.0.rst Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> * Update doc/users/prev_whats_new/whats_new_3.6.0.rst Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> * Update doc/users/prev_whats_new/whats_new_3.6.0.rst Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> * Update doc/users/prev_whats_new/whats_new_3.6.0.rst Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> * Squashed commit of the following: Squashed commit of the following: commit 015c997 Merge: b6400d2 6820797 commit b6400d2 Merge: 8b7f51c a30c0b1 commit 8b7f51c Merge: 7e42eaa f10d0d1 commit 7e42eaa commit 47e638b commit 2d17273 commit 02ad4ed commit 36638c8 commit 88f9e69 Merge: c310fab 11e37ac commit c310fab Merge: 3820d05 78f9c08 commit 3820d05 commit cd532aa commit 4ab0f52 commit 8d40c85 commit 447042f commit 1895995 commit adf6563 commit 34bbb24 Merge: a7dc972 651a874 commit a7dc972 Merge: 7547813 9a0b72a commit 7547813 commit d1dc422 commit 1503ed5 Merge: d3bf57d cb59251 commit cb59251 Merge: 9ffce62 ff17bc3 commit d3bf57d commit 9ffce62 Merge: 21a07fc ab6d190 commit 21a07fc commit ab6d190 Merge: cb03a55 d46628e commit cb03a55 --------- Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 parent 1b8ac91 commit 2f55cd5

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

doc/users/prev_whats_new/whats_new_3.6.0.rst

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ the :ref:`github-stats`.
1313

1414
Figure and Axes creation / management
1515
=====================================
16-
1716
``subplots``, ``subplot_mosaic`` accept *height_ratios* and *width_ratios* arguments
1817
------------------------------------------------------------------------------------
1918

@@ -22,6 +21,7 @@ The relative width and height of columns and rows in `~.Figure.subplots` and
2221
*width_ratios* keyword arguments to the methods:
2322

2423
.. plot::
24+
:alt: A figure with three subplots in three rows and one column. The height of the subplot in the first row is three times than the subplots in the 2nd and 3rd row.
2525
:include-source: true
2626

2727
fig = plt.figure()
@@ -58,6 +58,7 @@ With ``layout='tight'`` or ``'constrained'``, Axes with a fixed aspect ratio
5858
can leave large gaps between each other:
5959

6060
.. plot::
61+
:alt: A figure labelled "fixed-aspect plots, layout=constrained". Figure has subplots displayed in 2 rows and 2 columns; Subplots have large gaps between each other.
6162

6263
fig, axs = plt.subplots(2, 2, figsize=(5, 3),
6364
sharex=True, sharey=True, layout="constrained")
@@ -69,6 +70,7 @@ Using the ``layout='compressed'`` layout reduces the space between the Axes,
6970
and adds the extra space to the outer margins:
7071

7172
.. plot::
73+
:alt: Four identical two by two heatmaps, each cell a different color: purple, blue, yellow, green going clockwise from upper left corner. The four heatmaps are laid out in a two by two grid with minimum white space between the heatmaps.
7274

7375
fig, axs = plt.subplots(2, 2, figsize=(5, 3),
7476
sharex=True, sharey=True, layout='compressed')
@@ -96,6 +98,7 @@ with the previous layout engine.
9698
may be returned.
9799

98100
.. plot::
101+
:alt: Plot of a straight line y=x, with a small inset axes in the lower right corner that shows a circle with radial grid lines and a line plotted in polar coordinates.
99102
:include-source: true
100103

101104
fig, ax = plt.subplots()
@@ -147,6 +150,7 @@ The new *gapcolor* parameter to `~.Axes.plot` enables the creation of striped
147150
lines.
148151

149152
.. plot::
153+
:alt: Plot of x**3 where the line is an orange-blue striped line, achieved using the keywords linestyle='--', color='orange', gapcolor='blue'
150154
:include-source: true
151155

152156
x = np.linspace(1., 3., 10)
@@ -164,6 +168,7 @@ The new *capwidths* parameter to `~.Axes.bxp` and `~.Axes.boxplot` allows
164168
controlling the widths of the caps in box and whisker plots.
165169

166170
.. plot::
171+
:alt: A box plot with capwidths 0.01 and 0.2
167172
:include-source: true
168173

169174
x = np.linspace(-7, 7, 140)
@@ -184,6 +189,7 @@ label entries, so this is best used when bars also differ in style (e.g., by
184189
passing a list to *color*, as below.)
185190

186191
.. plot::
192+
:alt: Bar chart: blue bar height 10, orange bar height 20, green bar height 15 legend with blue box labeled a, orange box labeled b, and green box labeled c
187193
:include-source: true
188194

189195
x = ["a", "b", "c"]
@@ -214,6 +220,7 @@ The line style of negative contours may be set by passing the
214220
only be set globally via :rc:`contour.negative_linestyles`.
215221

216222
.. plot::
223+
:alt: Two contour plots, each showing two positive and two negative contours. The positive contours are shown in solid black lines in both plots. In one plot the negative contours are shown in dashed lines, which is the current styling. In the other plot they're shown in dotted lines, which is one of the new options.
217224
:include-source: true
218225

219226
delta = 0.025
@@ -273,6 +280,7 @@ passed to `.Line2D`, rather than claiming that all keyword arguments are passed
273280
on.
274281

275282
.. plot::
283+
:alt: Graph with error bar showing ±0.2 error on the x-axis, and ±0.4 error on the y-axis. Error bar marker is a circle radius 20. Error bar face color is blue.
276284
:include-source: true
277285

278286
x = np.arange(0.1, 4, 0.5)
@@ -293,7 +301,8 @@ streamlines. Previously streamlines would end to limit the number of lines
293301
within a single grid cell. See the difference between the plots below:
294302

295303
.. plot::
296-
304+
:alt: A figure with two streamplots. First streamplot has broken streamlines. Second streamplot has continuous streamlines.
305+
297306
w = 3
298307
Y, X = np.mgrid[-w:w:100j, -w:w:100j]
299308
U = -1 - X**2 + Y
@@ -317,6 +326,7 @@ the scale. This is based on an arcsinh transformation that allows plotting both
317326
positive and negative values that span many orders of magnitude.
318327

319328
.. plot::
329+
:alt: Figure with 2 subplots. Subplot on the left uses symlog scale on the y axis. The transition at -2 is not smooth. Subplot on the right use asinh scale. The transition at -2 is smooth.
320330

321331
fig, (ax0, ax1) = plt.subplots(1, 2, sharex=True)
322332
x = np.linspace(-3, 6, 100)
@@ -361,6 +371,7 @@ The rotation point of the `~matplotlib.patches.Rectangle` can now be set to
361371
'xy', 'center' or a 2-tuple of numbers using the *rotation_point* argument.
362372

363373
.. plot::
374+
:alt: Blue square that isn't rotated. Green square rotated 45 degrees relative to center. Orange square rotated 45 degrees relative to lower right corner. Red square rotated 45 degrees relative to point in upper right quadrant.
364375

365376
fig, ax = plt.subplots()
366377

@@ -437,6 +448,7 @@ It is now possible to set or get minor ticks using `.pyplot.xticks` and
437448
`.pyplot.yticks` by setting ``minor=True``.
438449

439450
.. plot::
451+
:alt: Plot showing a line from 1,2 to 3.5,-0.5. X axis showing the 1, 2 and 3 minor ticks on the x axis as One, Zwei, Trois.
440452
:include-source: true
441453

442454
plt.figure()
@@ -456,6 +468,7 @@ the keyword argument *alignment*. You can also use `.Legend.set_alignment` to
456468
control the alignment on existing Legends.
457469

458470
.. plot::
471+
:alt: Figure with 3 subplots. All the subplots are titled test. The three subplots have legends titled alignment='left', alignment='center', alignment='right'. The legend texts are respectively aligned left, center and right.
459472
:include-source: true
460473

461474
fig, axs = plt.subplots(3, 1)
@@ -489,6 +502,7 @@ for the user to supply a transformation to be applied to the marker (e.g. a
489502
rotation).
490503

491504
.. plot::
505+
:alt: Three rows of markers, columns are blue, green, and purple. First row is y-shaped markers with different capstyles: butt, end is squared off at endpoint; projecting, end is squared off at short distance from endpoint; round, end is rounded. Second row is star-shaped markers with different join styles: miter, star points are sharp triangles; round, star points are rounded; bevel, star points are beveled. Last row shows stars rotated at different angles: small star rotated 0 degrees - top point vertical; medium star rotated 45 degrees - top point tilted right; large star rotated 90 degrees - top point tilted left.
492506
:include-source: true
493507

494508
from matplotlib.markers import CapStyle, JoinStyle, MarkerStyle
@@ -593,6 +607,7 @@ weight can be set separately from the figure title using :rc:`figure.labelsize`
593607
and :rc:`figure.labelweight`.
594608

595609
.. plot::
610+
:alt: A figure with 4 plots organised in 2 rows and 2 columns. The title of the figure is suptitle in bold and 64 points. The x axis is labelled supxlabel, and y axis is labelled subylabel. Both labels are 32 points and bold.
596611
:include-source: true
597612

598613
# Original (previously combined with below) rcParams:
@@ -660,6 +675,7 @@ The focal length can be calculated from a desired FOV via the equation:
660675
focal\_length = 1/\tan(FOV/2)
661676

662677
.. plot::
678+
:alt: A figure showing 3 basic 3D Wireframe plots. From left to right, the plots use focal length of 0.2, 1 and infinity. Focal length between 0.2 and 1 produce plot with depth while focal length between 1 and infinity show relatively flattened image.
663679
:include-source: true
664680

665681
from mpl_toolkits.mplot3d import axes3d
@@ -685,6 +701,7 @@ programmatically. The default roll angle of 0 is backwards-compatible with
685701
existing 3D plots.
686702

687703
.. plot::
704+
:alt: View of a wireframe of a 3D contour that is somewhat a thickened s shape. Elevation and azimuth are 0 degrees so the shape is viewed straight on, but tilted because the roll is 30 degrees.
688705
:include-source: true
689706

690707
from mpl_toolkits.mplot3d import axes3d
@@ -704,6 +721,7 @@ Users can set the aspect ratio for the X, Y, Z axes of a 3D plot to be 'equal',
704721
'equalxy', 'equalxz', or 'equalyz' rather than the default of 'auto'.
705722

706723
.. plot::
724+
:alt: Five plots, each showing a different aspect option for a rectangle that has height 4, depth 1, and width 1. auto: none of the dimensions have equal aspect, depth and width form a rectangular and height appears shrunken in proportion. equal: all the dimensions have equal aspect. equalxy: width and depth equal, height not so looks shrunken in proportion. equalyz: depth and height equal, width not so elongated. equalxz: width and height equal, depth not so elongated.
707725
:include-source: true
708726

709727
from itertools import combinations, product

0 commit comments

Comments
 (0)
0