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

Skip to content

Commit cb03a55

Browse files
committed
alt text is added with .alt. directive
1 parent 78b2b0d commit cb03a55

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

doc/users/prev_whats_new/whats_new_3.6.0.rst

Lines changed: 44 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 3 subplots in 3 rows and 1 column. The hight of the subplot in the first row is 3 times more 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 5 by 3 inch figure with 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,8 @@ 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: 4 identical 2 by 2 heatmaps, each cell a different color: purple, blue, yellow, green going clockwise from upper left corner
74+
the 4 heatmaps are laid out in a 2 by 2 grid with minimum white space between the heatmaps
7275

7376
fig, axs = plt.subplots(2, 2, figsize=(5, 3),
7477
sharex=True, sharey=True, layout='compressed')
@@ -96,6 +99,7 @@ with the previous layout engine.
9699
may be returned.
97100

98101
.. plot::
102+
:alt: plot of a straight line y=x, with a small inset axis in the lower right corner that shows a circle with radial grid lines and a line plotted in polar coordinates
99103
:include-source: true
100104

101105
fig, ax = plt.subplots()
@@ -147,6 +151,7 @@ The new *gapcolor* parameter to `~.Axes.plot` enables the creation of striped
147151
lines.
148152

149153
.. plot::
154+
:alt: plot of x**3 where the line is an orange-blue striped line, achieved using the keywords`linestyle='--', color='orange', gapcolor='blue'
150155
:include-source: true
151156

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

166171
.. plot::
172+
:alt: A box plot with width 0.01 and 0.2
167173
:include-source: true
168174

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

186192
.. plot::
193+
:alt: bar chart: blue bar height 10, orange bar height 20, green bar height 15
194+
legend with blue box labeled a, orange box labeled b, and green box labeled c
187195
:include-source: true
188196

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

216224
.. plot::
225+
: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.
217226
:include-source: true
218227

219228
delta = 0.025
@@ -273,6 +282,7 @@ passed to `.Line2D`, rather than claiming that all keyword arguments are passed
273282
on.
274283

275284
.. plot::
285+
:alt: Graph with error bar showing + or - 0.2 error on the x-axis, and + or - 0.4 in the y axis. Error bar marker is a circle radius 20. Error bar face color is blue
276286
:include-source: true
277287

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

295305
.. plot::
296-
306+
:alt: A figure with two streamplots. First streamplot has broken streamlnes. Second streamplot has continuous streamlines
307+
297308
w = 3
298309
Y, X = np.mgrid[-w:w:100j, -w:w:100j]
299310
U = -1 - X**2 + Y
@@ -317,6 +328,7 @@ the scale. This is based on an arcsinh transformation that allows plotting both
317328
positive and negative values that span many orders of magnitude.
318329

319330
.. plot::
331+
:alt: A 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
320332

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

363375
.. plot::
376+
:alt: blue square that isn't rotated
377+
green square rotated 45 degrees relative to center
378+
orange square rotated 45 degrees relative to lower right corner
379+
red square rotated 45 degrees relative to point in upper right quadrant
364380

365381
fig, ax = plt.subplots()
366382

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

439455
.. plot::
456+
:alt: Plot showing a line from 1,2 to 3.5,-0.5. X axis showing the points 1,2 and 3 on the x axis as One, Zwei, Trois as minor ticks
440457
:include-source: true
441458

442459
plt.figure()
@@ -456,6 +473,7 @@ the keyword argument *alignment*. You can also use `.Legend.set_alignment` to
456473
control the alignment on existing Legends.
457474

458475
.. plot::
476+
: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
459477
:include-source: true
460478

461479
fig, axs = plt.subplots(3, 1)
@@ -489,6 +507,19 @@ for the user to supply a transformation to be applied to the marker (e.g. a
489507
rotation).
490508

491509
.. plot::
510+
:alt: hree rows of markers, columns are blue, green, and purple
511+
first row is yshaped markers with different capstyles:
512+
butt: end is squared off at endpoint
513+
projecting: end is squared off at short distance from endpoint
514+
round: end is rounded
515+
second row is star shaped markers with different join styles:
516+
miter: star points are sharp triangles
517+
round: star points are rounded
518+
bevel: star points are beveled
519+
last row shows stars rotated at different angles:
520+
small star rotated 0 degrees - top point vertical
521+
medium star rotated 45 degrees - top point tilted right
522+
large star rotated 90 degrees - top point tilted left
492523
:include-source: true
493524

494525
from matplotlib.markers import CapStyle, JoinStyle, MarkerStyle
@@ -593,6 +624,7 @@ weight can be set separately from the figure title using :rc:`figure.labelsize`
593624
and :rc:`figure.labelweight`.
594625

595626
.. plot::
627+
: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
596628
:include-source: true
597629

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

662694
.. plot::
695+
: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 betwen 0.2 and 1 produce plot with depth while focal length between 1 and infinity show relatively flattened image
663696
:include-source: true
664697

665698
from mpl_toolkits.mplot3d import axes3d
@@ -685,6 +718,8 @@ programmatically. The default roll angle of 0 is backwards-compatible with
685718
existing 3D plots.
686719

687720
.. plot::
721+
:alt: view of a wireframe of a 3d contour that is somewhat a thickend s shape
722+
elevation and azimuth are 0 degrees so the shape is veiwed straight on, but tilted because the roll is 30 degrees
688723
:include-source: true
689724

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

706741
.. plot::
742+
:alt: 5 plots, each showing a different aspect option for a rectangle that has height 4, depth 1, and width 1
743+
auto: none of the dimensions have equal aspect, depth and width form a rectangular and height appears shrunken in proportion
744+
equal: all the dimensions have equal aspect
745+
equalxy: width and depth equal, height not so looks shrunken in proportion
746+
equalyz: depth and height equal, width not so elongated
747+
equalxz: width and height equal, depth not so elongated
748+
707749
:include-source: true
708750

709751
from itertools import combinations, product

0 commit comments

Comments
 (0)