You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,6 +21,7 @@ The relative width and height of columns and rows in `~.Figure.subplots` and
22
21
*width_ratios* keyword arguments to the methods:
23
22
24
23
.. 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.
25
25
:include-source: true
26
26
27
27
fig = plt.figure()
@@ -58,6 +58,7 @@ With ``layout='tight'`` or ``'constrained'``, Axes with a fixed aspect ratio
58
58
can leave large gaps between each other:
59
59
60
60
.. 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.
61
62
62
63
fig, axs = plt.subplots(2, 2, figsize=(5, 3),
63
64
sharex=True, sharey=True, layout="constrained")
@@ -69,6 +70,7 @@ Using the ``layout='compressed'`` layout reduces the space between the Axes,
69
70
and adds the extra space to the outer margins:
70
71
71
72
.. 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.
72
74
73
75
fig, axs = plt.subplots(2, 2, figsize=(5, 3),
74
76
sharex=True, sharey=True, layout='compressed')
@@ -96,6 +98,7 @@ with the previous layout engine.
96
98
may be returned.
97
99
98
100
.. 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.
99
102
:include-source: true
100
103
101
104
fig, ax = plt.subplots()
@@ -147,6 +150,7 @@ The new *gapcolor* parameter to `~.Axes.plot` enables the creation of striped
147
150
lines.
148
151
149
152
.. 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'
150
154
:include-source: true
151
155
152
156
x = np.linspace(1., 3., 10)
@@ -164,6 +168,7 @@ The new *capwidths* parameter to `~.Axes.bxp` and `~.Axes.boxplot` allows
164
168
controlling the widths of the caps in box and whisker plots.
165
169
166
170
.. plot::
171
+
:alt: A box plot with capwidths 0.01 and 0.2
167
172
:include-source: true
168
173
169
174
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
184
189
passing a list to *color*, as below.)
185
190
186
191
.. 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
187
193
:include-source: true
188
194
189
195
x = ["a", "b", "c"]
@@ -214,6 +220,7 @@ The line style of negative contours may be set by passing the
214
220
only be set globally via :rc:`contour.negative_linestyles`.
215
221
216
222
.. 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.
217
224
:include-source: true
218
225
219
226
delta = 0.025
@@ -273,6 +280,7 @@ passed to `.Line2D`, rather than claiming that all keyword arguments are passed
273
280
on.
274
281
275
282
.. 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.
276
284
:include-source: true
277
285
278
286
x = np.arange(0.1, 4, 0.5)
@@ -293,7 +301,8 @@ streamlines. Previously streamlines would end to limit the number of lines
293
301
within a single grid cell. See the difference between the plots below:
294
302
295
303
.. plot::
296
-
304
+
:alt: A figure with two streamplots. First streamplot has broken streamlines. Second streamplot has continuous streamlines.
305
+
297
306
w = 3
298
307
Y, X = np.mgrid[-w:w:100j, -w:w:100j]
299
308
U = -1 - X**2 + Y
@@ -317,6 +326,7 @@ the scale. This is based on an arcsinh transformation that allows plotting both
317
326
positive and negative values that span many orders of magnitude.
318
327
319
328
.. 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.
320
330
321
331
fig, (ax0, ax1) = plt.subplots(1, 2, sharex=True)
322
332
x = np.linspace(-3, 6, 100)
@@ -361,6 +371,7 @@ The rotation point of the `~matplotlib.patches.Rectangle` can now be set to
361
371
'xy', 'center' or a 2-tuple of numbers using the *rotation_point* argument.
362
372
363
373
.. 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.
364
375
365
376
fig, ax = plt.subplots()
366
377
@@ -437,6 +448,7 @@ It is now possible to set or get minor ticks using `.pyplot.xticks` and
437
448
`.pyplot.yticks` by setting ``minor=True``.
438
449
439
450
.. 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.
440
452
:include-source: true
441
453
442
454
plt.figure()
@@ -456,6 +468,7 @@ the keyword argument *alignment*. You can also use `.Legend.set_alignment` to
456
468
control the alignment on existing Legends.
457
469
458
470
.. 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.
459
472
:include-source: true
460
473
461
474
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
489
502
rotation).
490
503
491
504
.. 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.
492
506
:include-source: true
493
507
494
508
from matplotlib.markers import CapStyle, JoinStyle, MarkerStyle
@@ -593,6 +607,7 @@ weight can be set separately from the figure title using :rc:`figure.labelsize`
593
607
and :rc:`figure.labelweight`.
594
608
595
609
.. 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.
596
611
:include-source: true
597
612
598
613
# Original (previously combined with below) rcParams:
@@ -660,6 +675,7 @@ The focal length can be calculated from a desired FOV via the equation:
660
675
focal\_length = 1/\tan(FOV/2)
661
676
662
677
.. 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.
663
679
:include-source: true
664
680
665
681
from mpl_toolkits.mplot3d import axes3d
@@ -685,6 +701,7 @@ programmatically. The default roll angle of 0 is backwards-compatible with
685
701
existing 3D plots.
686
702
687
703
.. 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.
688
705
:include-source: true
689
706
690
707
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',
704
721
'equalxy', 'equalxz', or 'equalyz' rather than the default of 'auto'.
705
722
706
723
.. 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.
0 commit comments