@@ -22,6 +22,13 @@ The relative width and height of columns and rows in `~.Figure.subplots` and
22
22
*width_ratios * keyword arguments to the methods. Previously, this required
23
23
passing the ratios in *gridspec_kws * arguments.
24
24
25
+ Constrained layout is no longer considered experimental
26
+ -------------------------------------------------------
27
+
28
+ The constrained layout engine and API is no longer considered experimental.
29
+ Arbitrary changes to behaviour and API are no longer permitted without a
30
+ deprecation period.
31
+
25
32
New ``layout_engine `` module
26
33
----------------------------
27
34
@@ -30,13 +37,65 @@ engines. A new `.layout_engine` module is provided to allow downstream
30
37
libraries to write their own layout engines and `~.figure.Figure ` objects can
31
38
now take a `.LayoutEngine ` subclass as an argument to the *layout * parameter.
32
39
40
+ Compressed layout for fixed-aspect ratio Axes
41
+ ---------------------------------------------
42
+
43
+ Simple arrangements of Axes with fixed aspect ratios can now be packed together
44
+ with ``fig, axs = plt.subplots(2, 3, layout='compressed') ``. With
45
+ ``layout='tight' `` or ``'constrained' ``, Axes with a fixed aspect ratio can
46
+ leave large gaps between each other. Using the ``layout='compressed' `` layout
47
+ reduces the space between the Axes, and adds the extra space to the outer
48
+ margins. See :ref: `compressed_layout `.
49
+
50
+ Layout engines may now be removed
51
+ ---------------------------------
52
+
53
+ The layout engine on a Figure may now be removed by calling
54
+ `.Figure.set_layout_engine ` with ``'none' ``. This may be useful after computing
55
+ layout in order to reduce computations, e.g., for subsequent animation loops.
56
+
57
+ A different layout engine may be set afterwards, so long as it is compatible
58
+ with the previous layout engine.
59
+
33
60
``Axes.inset_axes `` flexibility
34
61
-------------------------------
35
62
36
63
`matplotlib.axes.Axes.inset_axes ` now accepts the *projection *, *polar * and
37
64
*axes_class * keyword arguments, so that subclasses of `matplotlib.axes.Axes `
38
65
may be returned.
39
66
67
+ WebP is now a supported output format
68
+ -------------------------------------
69
+
70
+ Figures may now be saved in WebP format by using the ``.webp `` file extension,
71
+ or passing ``format='webp' `` to `~.Figure.savefig `. This relies on `Pillow
72
+ <https://pillow.readthedocs.io/en/latest/> `_ support for WebP.
73
+
74
+ Garbage collection is no longer run on figure close
75
+ ---------------------------------------------------
76
+
77
+ Matplotlib has a large number of circular references (between Figure and
78
+ Manager, between Axes and Figure, Axes and Artist, Figure and Canvas, etc.) so
79
+ when the user drops their last reference to a Figure (and clears it from
80
+ pyplot's state), the objects will not immediately be deleted.
81
+
82
+ To account for this we have long (since before 2004) had a `gc.collect ` (of the
83
+ lowest two generations only) in the closing code in order to promptly clean up
84
+ after ourselves. However this is both not doing what we want (as most of our
85
+ objects will actually survive) and due to clearing out the first generation
86
+ opened us up to having unbounded memory usage.
87
+
88
+ In cases with a very tight loop between creating the figure and destroying it
89
+ (e.g. ``plt.figure(); plt.close() ``) the first generation will never grow large
90
+ enough for Python to consider running the collection on the higher generations.
91
+ This will lead to unbounded memory usage as the long-lived objects are never
92
+ re-considered to look for reference cycles and hence are never deleted.
93
+
94
+ We now no longer do any garbage collection when a figure is closed, and rely on
95
+ Python automatically deciding to run garbage collection periodically. If you
96
+ have strict memory requirements, you can call `gc.collect ` yourself but this
97
+ may have performance impacts in a tight computation loop.
98
+
40
99
Plotting methods
41
100
================
42
101
@@ -95,8 +154,21 @@ bars.
95
154
bar_container = ax.barh(x, y, label = x)
96
155
[bar.get_label() for bar in bar_container]
97
156
98
- New external dependency ContourPy used for quad contour calculations
99
- --------------------------------------------------------------------
157
+ New style format string for colorbar ticks
158
+ ------------------------------------------
159
+
160
+ The *format * argument of `~.Figure.colorbar ` (and other colorbar methods) now
161
+ accepts ``{} ``-style format strings.
162
+
163
+ Linestyles for negative contours may be set individually
164
+ --------------------------------------------------------
165
+
166
+ The line style of negative contours may be set by passing the
167
+ *negative_linestyles * argument to `.Axes.contour `. Previously, this style could
168
+ only be set globally via :rc: `contour.negative_linestyles `.
169
+
170
+ ContourPy used for quad contour calculations
171
+ --------------------------------------------
100
172
101
173
Previously Matplotlib shipped its own C++ code for calculating the contours of
102
174
quad grids. Now the external library `ContourPy
@@ -122,6 +194,14 @@ further details of the different algorithms.
122
194
The locations of contour labels obtained by using `~.axes.Axes.clabel ` may
123
195
also be different.
124
196
197
+ ``errorbar `` supports *markerfacecoloralt *
198
+ ------------------------------------------
199
+
200
+ The *markerfacecoloralt * parameter is now passed to the line plotter from
201
+ `.Axes.errorbar `. The documentation now accurately lists which properties are
202
+ passed to `.Line2D `, rather than claiming that all keyword arguments are passed
203
+ on.
204
+
125
205
``streamplot `` can disable streamline breaks
126
206
--------------------------------------------
127
207
@@ -206,6 +286,14 @@ The rotation point of the `~matplotlib.patches.Rectangle` can now be set to
206
286
Colors and colormaps
207
287
====================
208
288
289
+ Color sequence registry
290
+ -----------------------
291
+
292
+ The color sequence registry, `.ColorSequenceRegistry `, contains sequences
293
+ (i.e., simple lists) of colors that are known to Matplotlib by name. This will
294
+ not normally be used directly, but through the universal instance at
295
+ `matplotlib.color_sequences `.
296
+
209
297
Colormap method for creating a different lookup table size
210
298
----------------------------------------------------------
211
299
@@ -371,6 +459,12 @@ Note that if you have changed :rc:`figure.titlesize` or
371
459
:rc: `figure.titleweight `, you must now also change the introduced parameters
372
460
for a consistent result with past behaviour.
373
461
462
+ Mathtext parsing can be disabled globally
463
+ -----------------------------------------
464
+
465
+ The :rc: `text.parse_math ` setting may be used to disable parsing of mathtext in
466
+ all `.Text ` objects (most notably from the `.Axes.text ` method).
467
+
374
468
Double-quoted strings in matplotlibrc
375
469
-------------------------------------
376
470
@@ -385,6 +479,14 @@ In particular, you can now define hex-colors:
385
479
3D Axes improvements
386
480
====================
387
481
482
+ Standardized views for primary plane viewing angles
483
+ ---------------------------------------------------
484
+
485
+ When viewing a 3D plot in one of the primary view planes (i.e., perpendicular
486
+ to the XY, XZ, or YZ planes), the Axis will be displayed in a standard
487
+ location. For further information on 3D views, see
488
+ :ref: `toolkit_mplot3d-view-angles ` and :doc: `/gallery/mplot3d/view_planes_3d `.
489
+
388
490
Custom focal length for 3D camera
389
491
---------------------------------
390
492
@@ -547,9 +649,63 @@ selector, and create a new complete selector with the supplied vertices.
547
649
The `.SpanSelector ` widget can now be snapped to values specified by the
548
650
*snap_values * argument.
549
651
652
+ More toolbar icons are styled for dark themes
653
+ ---------------------------------------------
654
+
655
+ On the macOS and Tk backends, toolbar icons will now be inverted when using a
656
+ dark theme.
657
+
550
658
Platform-specific changes
551
659
=========================
552
660
661
+ Wx backend uses standard toolbar
662
+ --------------------------------
663
+
664
+ Instead of a custom sizer, the toolbar is set on Wx windows as a standard
665
+ toolbar.
666
+
667
+ Improvements to macosx backend
668
+ ------------------------------
669
+
670
+ Modifier keys handled more consistently
671
+ .......................................
672
+
673
+ The macosx backend now handles modifier keys in a manner more consistent with
674
+ other backends. See the table in :ref: `event-connections ` for further
675
+ information.
676
+
677
+ ``savefig.directory `` rcParam support
678
+ .....................................
679
+
680
+ The macosx backend will now obey the :rc: `savefig.directory ` setting. If set to
681
+ a non-empty string, then the save dialog will default to this directory, and
682
+ preserve subsequent save directories as they are changed.
683
+
684
+ ``figure.raise_window `` rcParam support
685
+ .......................................
686
+
687
+ The macosx backend will now obey the :rc: `figure.raise_window ` setting. If set
688
+ to False, figure windows will not be raised to the top on update.
689
+
690
+ Full-screen toggle support
691
+ ..........................
692
+
693
+ As supported on other backends, the macosx backend now supports toggling
694
+ fullscreen view. By default, this view can be toggled by pressing the :kbd: `f `
695
+ key.
696
+
697
+ Improved animation and blitting support
698
+ .......................................
699
+
700
+ The macosx backend has been improved to fix blitting, animation frames with new
701
+ artists, and to reduce unnecessary draw calls.
702
+
703
+ macOS application icon applied on Qt backend
704
+ --------------------------------------------
705
+
706
+ When using the Qt-based backends on macOS, the application icon will now be
707
+ set, as is done on other backends/platforms.
708
+
553
709
New minimum macOS version
554
710
-------------------------
555
711
0 commit comments