@@ -14,6 +14,26 @@ the :ref:`github-stats`.
14
14
Figure and Axes creation / management
15
15
=====================================
16
16
17
+ ``subplot_mosaic `` supports simple Axes sharing
18
+ -----------------------------------------------
19
+
20
+ `.Figure.subplot_mosaic `, `.pyplot.subplot_mosaic ` support *simple * Axes
21
+ sharing (i.e., only `True `/`False ` may be passed to *sharex */*sharey *). When
22
+ `True `, tick label visibility and Axis units will be shared.
23
+
24
+ .. plot ::
25
+ :include-source:
26
+
27
+ mosaic = [
28
+ ['A', [['B', 'C'],
29
+ ['D', 'E']]],
30
+ ['F', 'G'],
31
+ ]
32
+ fig = plt.figure(constrained_layout=True)
33
+ ax_dict = fig.subplot_mosaic(mosaic, sharex=True, sharey=True)
34
+ # All Axes use these scales after this call.
35
+ ax_dict['A'].set(xscale='log', yscale='logit')
36
+
17
37
Figure now has ``draw_without_rendering `` method
18
38
------------------------------------------------
19
39
@@ -161,6 +181,12 @@ being "rgba" for the newly-available behavior.
161
181
For more details see the discussion of the new keyword argument in
162
182
:doc: `/gallery/images_contours_and_fields/image_antialiasing `.
163
183
184
+ ``imshow `` supports half-float arrays
185
+ -------------------------------------
186
+
187
+ The `~.axes.Axes.imshow ` method now supports half-float arrays, i.e., NumPy
188
+ arrays with dtype ``np.float16 ``.
189
+
164
190
A callback registry has been added to Normalize objects
165
191
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
166
192
@@ -202,6 +228,19 @@ parameter.
202
228
Fonts and Text
203
229
==============
204
230
231
+ Triple and quadruple dot mathtext accents
232
+ -----------------------------------------
233
+
234
+ In addition to single and double dot accents, mathtext now supports triple and
235
+ quadruple dot accents.
236
+
237
+ .. plot ::
238
+ :include-source:
239
+
240
+ fig = plt.figure(figsize=(3, 1))
241
+ fig.text(0.5, 0.5, r'$\d ot{a} \d dot{b} \d ddot{c} \d dddot{d}$', fontsize=40,
242
+ horizontalalignment='center', verticalalignment='center')
243
+
205
244
Font properties of legend title are configurable
206
245
------------------------------------------------
207
246
@@ -215,6 +254,14 @@ argument, for example:
215
254
ax.legend(title='Points',
216
255
title_fontproperties={'family': 'serif', 'size': 20})
217
256
257
+ ``Text `` and ``TextBox `` added *parse_math * option
258
+ --------------------------------------------------
259
+
260
+ `.Text ` and `.TextBox ` objects now allow a *parse_math * keyword-only argument
261
+ which controls whether math should be parsed from the displayed string. If
262
+ *True *, the string will be parsed as a math text object. If *False *, the string
263
+ will be considered a literal and no parsing will occur.
264
+
218
265
Text can be positioned inside TextBox widget
219
266
--------------------------------------------
220
267
@@ -364,9 +411,61 @@ Allow changing the vertical axis in 3d plots
364
411
ax.set(xlabel='x', ylabel='y', zlabel='z',
365
412
title=f'vertical_axis={vert_a!r}')
366
413
414
+ ``plot_surface `` supports masked arrays and NaNs
415
+ ------------------------------------------------
416
+
417
+ `.axes3d.Axes3D.plot_surface ` supports masked arrays and NaNs, and will now
418
+ hide quads that contain masked or NaN points. The behaviour is similar to
419
+ `.Axes.contour ` with ``corner_mask=True ``.
420
+
421
+ .. plot ::
422
+
423
+ import matplotlib
424
+ import matplotlib.pyplot as plt
425
+ import numpy as np
426
+
427
+ fig, ax = plt.subplots(figsize=(6, 6), subplot_kw={'projection': '3d'},
428
+ constrained_layout=True)
429
+
430
+ x, y = np.mgrid[1:10:1, 1:10:1]
431
+ z = x ** 3 + y ** 3 - 500
432
+ z = np.ma.masked_array(z, z < 0)
433
+
434
+ ax.plot_surface(x, y, z, rstride=1, cstride=1, linewidth=0, cmap='inferno')
435
+ ax.view_init(35, -90)
436
+
437
+ 3D plotting methods support *data * keyword argument
438
+ ---------------------------------------------------
439
+
440
+ To match all 2D plotting methods, the 3D Axes now support the *data * keyword
441
+ argument. This allows passing arguments indirectly from a DataFrame-like
442
+ structure. ::
443
+
444
+ data = { # A labelled data set, or e.g., Pandas DataFrame.
445
+ 'x': ...,
446
+ 'y': ...,
447
+ 'z': ...,
448
+ 'width': ...,
449
+ 'depth': ...,
450
+ 'top': ...,
451
+ }
452
+
453
+ fig, ax = plt.subplots(subplot_kw={'projection': '3d')
454
+ ax.bar3d('x', 'y', 'z', 'width', 'depth', 'top', data=data)
455
+
367
456
Interactive tool improvements
368
457
=============================
369
458
459
+ Colorbars now have pan and zoom functionality
460
+ ---------------------------------------------
461
+
462
+ Interactive plots with colorbars can now be zoomed and panned on the colorbar
463
+ axis. This adjusts the *vmin * and *vmax * of the ``ScalarMappable `` associated
464
+ with the colorbar. This is currently only enabled for continuous norms. Norms
465
+ used with contourf and categoricals, such as ``BoundaryNorm `` and ``NoNorm ``,
466
+ have the interactive capability disabled by default. ``cb.ax.set_navigate() ``
467
+ can be used to set whether a colorbar axes is interactive or not.
468
+
370
469
Updated the appearance of Slider widgets
371
470
----------------------------------------
372
471
@@ -480,6 +579,14 @@ from being processed and let all other signals pass.
480
579
with fig.canvas.callbacks.blocked(signal="key_press_event"):
481
580
plt.show()
482
581
582
+ Directional sizing cursors
583
+ --------------------------
584
+
585
+ Canvases now support setting directional sizing cursors, i.e., horizontal and
586
+ vertical double arrows. These are used in e.g., selector widgets. Try the
587
+ :doc: `/gallery/widgets/mouse_cursor ` example to see the cursor in your desired
588
+ backend.
589
+
483
590
Sphinx extensions
484
591
=================
485
592
0 commit comments