@@ -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
+ layout = [
28
+ ['A', [['B', 'C'],
29
+ ['D', 'E']]],
30
+ ['F', 'G'],
31
+ ]
32
+ fig = plt.figure(constrained_layout=True)
33
+ ax_dict = fig.subplot_mosaic(layout, 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 of ``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
@@ -358,9 +405,61 @@ Allow changing the vertical axis in 3d plots
358
405
ax.set(xlabel='x', ylabel='y', zlabel='z',
359
406
title=f'vertical_axis={vert_a!r}')
360
407
408
+ ``plot_surface `` supports masked arrays and NaNs
409
+ ------------------------------------------------
410
+
411
+ `.axes3d.Axes3D.plot_surface ` supports masked arrays and NaNs, and will now
412
+ hide quads that contain masked or NaN points. The behaviour is similar to
413
+ `.Axes.contour ` with ``corner_mask=True ``.
414
+
415
+ .. plot ::
416
+
417
+ import matplotlib
418
+ import matplotlib.pyplot as plt
419
+ import numpy as np
420
+
421
+ fig, ax = plt.subplots(figsize=(6, 6), subplot_kw={'projection': '3d'},
422
+ constrained_layout=True)
423
+
424
+ x, y = np.mgrid[1:10:1, 1:10:1]
425
+ z = x ** 3 + y ** 3 - 500
426
+ z = np.ma.masked_array(z, z < 0)
427
+
428
+ ax.plot_surface(x, y, z, rstride=1, cstride=1, linewidth=0, cmap='inferno')
429
+ ax.view_init(35, -90)
430
+
431
+ 3D plotting methods support *data * keyword argument
432
+ ---------------------------------------------------
433
+
434
+ To match all 2D plotting methods, the 3D Axes now support the *data * keyword
435
+ argument. This allows passing arguments indirectly from a DataFrame-like
436
+ structure. ::
437
+
438
+ data = { # A labelled data set, or e.g., Pandas DataFrame.
439
+ 'x': ...,
440
+ 'y': ...,
441
+ 'z': ...,
442
+ 'width': ...,
443
+ 'depth': ...,
444
+ 'top': ...,
445
+ }
446
+
447
+ fig, ax = plt.subplots(subplot_kw={'projection': '3d')
448
+ ax.bar3d('x', 'y', 'z', 'width', 'depth', 'top', data=data)
449
+
361
450
Interactive tool improvements
362
451
=============================
363
452
453
+ Colorbars now have pan and zoom functionality
454
+ ---------------------------------------------
455
+
456
+ Interactive plots with colorbars can now be zoomed and panned on the colorbar
457
+ axis. This adjusts the *vmin * and *vmax * of the ``ScalarMappable `` associated
458
+ with the colorbar. This is currently only enabled for continuous norms. Norms
459
+ used with contourf and categoricals, such as ``BoundaryNorm `` and ``NoNorm ``,
460
+ have the interactive capability disabled by default. ``cb.ax.set_navigate() ``
461
+ can be used to set whether a colorbar axes is interactive or not.
462
+
364
463
Updated the appearance of Slider widgets
365
464
----------------------------------------
366
465
@@ -474,6 +573,14 @@ from being processed and let all other signals pass.
474
573
with fig.canvas.callbacks.blocked(signal="key_press_event"):
475
574
plt.show()
476
575
576
+ Directional sizing cursors
577
+ --------------------------
578
+
579
+ Canvases now support setting directional sizing cursors, i.e., horizontal and
580
+ vertical double arrows. These are used in e.g., selector widgets. Try the
581
+ :doc: `/gallery/widgets/mouse_cursor ` example to see the cursor in your desired
582
+ backend.
583
+
477
584
Sphinx extensions
478
585
=================
479
586
0 commit comments