Skip to content

Commit 6b57bca

Browse files
committed
Add additional 3.6 What's new entries
1 parent 4b9903b commit 6b57bca

File tree

1 file changed

+158
-2
lines changed

1 file changed

+158
-2
lines changed

doc/users/prev_whats_new/whats_new_3.6.0.rst

Lines changed: 158 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ The relative width and height of columns and rows in `~.Figure.subplots` and
2222
*width_ratios* keyword arguments to the methods. Previously, this required
2323
passing the ratios in *gridspec_kws* arguments.
2424

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+
2532
New ``layout_engine`` module
2633
----------------------------
2734

@@ -30,13 +37,65 @@ engines. A new `.layout_engine` module is provided to allow downstream
3037
libraries to write their own layout engines and `~.figure.Figure` objects can
3138
now take a `.LayoutEngine` subclass as an argument to the *layout* parameter.
3239

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+
3360
``Axes.inset_axes`` flexibility
3461
-------------------------------
3562

3663
`matplotlib.axes.Axes.inset_axes` now accepts the *projection*, *polar* and
3764
*axes_class* keyword arguments, so that subclasses of `matplotlib.axes.Axes`
3865
may be returned.
3966

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+
4099
Plotting methods
41100
================
42101

@@ -86,8 +145,21 @@ bars.
86145
bar_container = ax.barh(x, y, label=x)
87146
[bar.get_label() for bar in bar_container]
88147
89-
New external dependency ContourPy used for quad contour calculations
90-
--------------------------------------------------------------------
148+
New style format string for colorbar ticks
149+
------------------------------------------
150+
151+
The *format* argument of `~.Figure.colorbar` (and other colorbar methods) now
152+
accepts ``{}``-style format strings.
153+
154+
Linestyles for negative contours may be set individually
155+
--------------------------------------------------------
156+
157+
The line style of negative contours may be set by passing the
158+
*negative_linestyles* argument to `.Axes.contour`. Previously, this style could
159+
only be set globally via :rc:`contour.negative_linestyles`.
160+
161+
ContourPy used for quad contour calculations
162+
--------------------------------------------
91163

92164
Previously Matplotlib shipped its own C++ code for calculating the contours of
93165
quad grids. Now the external library `ContourPy
@@ -113,6 +185,14 @@ further details of the different algorithms.
113185
The locations of contour labels obtained by using `~.axes.Axes.clabel` may
114186
also be different.
115187

188+
``errorbar`` supports *markerfacecoloralt*
189+
------------------------------------------
190+
191+
The *markerfacecoloralt* parameter is now passed to the line plotter from
192+
`.Axes.errorbar`. The documentation now accurately lists which properties are
193+
passed to `.Line2D`, rather than claiming that all keyword arguments are passed
194+
on.
195+
116196
``streamplot`` can disable streamline breaks
117197
--------------------------------------------
118198

@@ -191,6 +271,14 @@ The rotation point of the `~matplotlib.patches.Rectangle` can now be set to
191271
Colors and colormaps
192272
====================
193273

274+
Color sequence registry
275+
-----------------------
276+
277+
The color sequence registry, `.ColorSequenceRegistry`, contains sequences
278+
(i.e., simple lists) of colors that are known to Matplotlib by name. This will
279+
not normally be used directly, but through the universal instance at
280+
`matplotlib.color_sequences`.
281+
194282
Colormap method for creating a different lookup table size
195283
----------------------------------------------------------
196284

@@ -350,6 +438,12 @@ Note that if you have changed :rc:`figure.titlesize` or
350438
:rc:`figure.titleweight`, you must now also change the introduced parameters
351439
for a result consistent with past behaviour.
352440

441+
Mathtext parsing can be disabled globally
442+
-----------------------------------------
443+
444+
The :rc:`text.parse_math` setting may be used to disable parsing of mathtext in
445+
all `.Text` objects (most notably from the `.Axes.text` method).
446+
353447
Double-quoted strings in matplotlibrc
354448
-------------------------------------
355449

@@ -364,6 +458,14 @@ In particular, you can now define hex-colors:
364458
3D Axes improvements
365459
====================
366460

461+
Standardized views for primary plane viewing angles
462+
---------------------------------------------------
463+
464+
When viewing a 3D plot in one of the primary view planes (i.e., perpendicular
465+
to the XY, XZ, or YZ planes), the Axis will be displayed in a standard
466+
location. For further information on 3D views, see
467+
:ref:`toolkit_mplot3d-view-angles` and :doc:`/gallery/mplot3d/view_planes_3d`.
468+
367469
Custom focal length for 3D camera
368470
---------------------------------
369471

@@ -517,9 +619,63 @@ selector, and create a new complete selector with the supplied vertices.
517619
The `.SpanSelector` widget can now be snapped to values specified by the
518620
*snap_values* argument.
519621

622+
More toolbar icons are styled for dark themes
623+
---------------------------------------------
624+
625+
On the macOS and Tk backends, toolbar icons will now be inverted when using a
626+
dark theme.
627+
520628
Platform-specific changes
521629
=========================
522630

631+
Wx backend uses standard toolbar
632+
--------------------------------
633+
634+
Instead of a custom sizer, the toolbar is set on Wx windows as a standard
635+
toolbar.
636+
637+
Improvements to macosx backend
638+
------------------------------
639+
640+
Modifier keys handled more consistently
641+
.......................................
642+
643+
The macosx backend now handles modifier keys in a manner more consistent with
644+
other backends. See the table in :ref:`event-connections` for further
645+
information.
646+
647+
``savefig.directory`` rcParam support
648+
.....................................
649+
650+
The macosx backend will now obey the :rc:`savefig.directory` setting. If set to
651+
a non-empty string, then the save dialog will default to this directory, and
652+
preserve subsequent save directories as they are changed.
653+
654+
``figure.raise_window`` rcParam support
655+
.......................................
656+
657+
The macosx backend will now obey the :rc:`figure.raise_window` setting. If set
658+
to False, figure windows will not be raised to the top on update.
659+
660+
Full-screen toggle support
661+
..........................
662+
663+
As supported on other backends, the macosx backend now supports toggling
664+
fullscreen view. By default, this view can be toggled by pressing the :kbd:`f`
665+
key.
666+
667+
Improved animation and blitting support
668+
.......................................
669+
670+
The macosx backend has been improved to fix blitting, animation frames with new
671+
artists, and to reduce unnecessary draw calls.
672+
673+
macOS application icon applied on Qt backend
674+
--------------------------------------------
675+
676+
When using the Qt-based backends on macOS, the application icon will now be
677+
set, as is done on other backends/platforms.
678+
523679
New minimum macOS version
524680
-------------------------
525681

0 commit comments

Comments
 (0)