diff --git a/doc/api/next_api_changes/behavior/22347-RQ.rst b/doc/api/next_api_changes/behavior/22347-RQ.rst deleted file mode 100644 index b99d183943a5..000000000000 --- a/doc/api/next_api_changes/behavior/22347-RQ.rst +++ /dev/null @@ -1,13 +0,0 @@ -Correctly treat pan/zoom events of overlapping Axes ---------------------------------------------------- - -The forwarding of pan/zoom events is now determined by the visibility of the -background-patch (e.g. ``ax.patch.get_visible()``) and by the ``zorder`` of the axes. - -- Axes with a visible patch capture the event and do not pass it on to axes below. - Only the Axes with the highest ``zorder`` that contains the event is triggered - (if there are multiple Axes with the same ``zorder``, the last added Axes counts) -- Axes with an invisible patch are also invisible to events and they are passed on to the axes below. - -To override the default behavior and explicitly set whether an Axes -should forward navigation events, use `.Axes.set_forward_navigation_events`. diff --git a/doc/api/next_api_changes/behavior/26634-TH.rst b/doc/api/next_api_changes/behavior/26634-TH.rst deleted file mode 100644 index 4961722078d6..000000000000 --- a/doc/api/next_api_changes/behavior/26634-TH.rst +++ /dev/null @@ -1,5 +0,0 @@ -``SubplotParams`` has been moved from ``matplotlib.figure`` to ``matplotlib.gridspec`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -It is still importable from ``matplotlib.figure``, so does not require any changes to -existing code. diff --git a/doc/api/next_api_changes/behavior/26696-SR.rst b/doc/api/next_api_changes/behavior/26696-SR.rst deleted file mode 100644 index 231f412e426d..000000000000 --- a/doc/api/next_api_changes/behavior/26696-SR.rst +++ /dev/null @@ -1,6 +0,0 @@ -*loc* parameter of ``Cell`` doesn't accept ``None`` anymore -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The default value of the *loc* parameter has been changed from ``None`` to ``right``, -which already was the default location. The behavior of `.Cell` didn't change when -called without an explicit *loc* parameter. diff --git a/doc/api/next_api_changes/behavior/26788-AL.rst b/doc/api/next_api_changes/behavior/26788-AL.rst deleted file mode 100644 index 14573e870843..000000000000 --- a/doc/api/next_api_changes/behavior/26788-AL.rst +++ /dev/null @@ -1,6 +0,0 @@ -``axvspan`` and ``axhspan`` now return ``Rectangle``\s, not ``Polygons`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This change allows using `~.Axes.axhspan` to draw an annulus on polar axes. - -This change also affects other elements built via `~.Axes.axvspan` and -`~.Axes.axhspan`, such as ``Slider.poly``. diff --git a/doc/api/next_api_changes/behavior/26902-RP.rst b/doc/api/next_api_changes/behavior/26902-RP.rst deleted file mode 100644 index 3106de94fbd5..000000000000 --- a/doc/api/next_api_changes/behavior/26902-RP.rst +++ /dev/null @@ -1,5 +0,0 @@ -``Line2D`` -~~~~~~~~~~ - -When creating a Line2D or using `.Line2D.set_xdata` and `.Line2D.set_ydata`, -passing x/y data as non sequence is now an error. diff --git a/doc/api/next_api_changes/behavior/26917-AL.rst b/doc/api/next_api_changes/behavior/26917-AL.rst deleted file mode 100644 index 7872caf3204d..000000000000 --- a/doc/api/next_api_changes/behavior/26917-AL.rst +++ /dev/null @@ -1,3 +0,0 @@ -``ContourLabeler.add_label`` now respects *use_clabeltext* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... and sets `.Text.set_transform_rotates_text` accordingly. diff --git a/doc/api/next_api_changes/behavior/27179-KS.rst b/doc/api/next_api_changes/behavior/27179-KS.rst deleted file mode 100644 index 873cd622bbd4..000000000000 --- a/doc/api/next_api_changes/behavior/27179-KS.rst +++ /dev/null @@ -1,7 +0,0 @@ -Default behavior of ``hexbin`` with *C* provided requires at least 1 point -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The behavior changed in 3.8.0 to be inclusive of *mincnt*. However that resulted in -errors or warnings with some reduction functions, so now the default is to require at -least 1 point to call the reduction function. This effectively restores the default -behavior to match that of Matplotlib 3.7 and before. diff --git a/doc/api/next_api_changes/behavior/27347-GL.rst b/doc/api/next_api_changes/behavior/27347-GL.rst deleted file mode 100644 index 2cf8f65cd745..000000000000 --- a/doc/api/next_api_changes/behavior/27347-GL.rst +++ /dev/null @@ -1,7 +0,0 @@ -ScalarMappables auto-scale their norm when an array is set -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Collections previously deferred auto-scaling of the norm until draw time. -This has been changed to scale the norm whenever the first array is set -to align with the docstring and reduce unexpected behavior when -accessing the norm before drawing. diff --git a/doc/api/next_api_changes/behavior/27469-AL.rst b/doc/api/next_api_changes/behavior/27469-AL.rst deleted file mode 100644 index c47397e873b7..000000000000 --- a/doc/api/next_api_changes/behavior/27469-AL.rst +++ /dev/null @@ -1,11 +0,0 @@ -``loc='best'`` for ``legend`` now considers ``Text`` and ``PolyCollections`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The location selection ``legend`` now considers the existence of ``Text`` -and ``PolyCollections`` in the ``badness`` calculation. - -Note: The ``best`` option can already be quite slow for plots with large -amounts of data. For ``PolyCollections``, it only considers the ``Path`` -of ``PolyCollections`` and not the enclosed area when checking for overlap -to reduce additional latency. However, it can still be quite slow when -there are large amounts of ``PolyCollections`` in the plot to check for. diff --git a/doc/api/next_api_changes/behavior/27492-AL.rst b/doc/api/next_api_changes/behavior/27492-AL.rst deleted file mode 100644 index 98a4900fa67d..000000000000 --- a/doc/api/next_api_changes/behavior/27492-AL.rst +++ /dev/null @@ -1,12 +0,0 @@ -Image path semantics of toolmanager-based tools -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Previously, MEP22 ("toolmanager-based") Tools would try to load their icon -(``tool.image``) relative to the current working directory, or, as a fallback, -from Matplotlib's own image directory. Because both approaches are problematic -for third-party tools (the end-user may change the current working directory -at any time, and third-parties cannot add new icons in Matplotlib's image -directory), this behavior is deprecated; instead, ``tool.image`` is now -interpreted relative to the directory containing the source file where the -``Tool.image`` class attribute is defined. (Defining ``tool.image`` as an -absolute path also works and is compatible with both the old and the new -semantics.) diff --git a/doc/api/next_api_changes/behavior/27514-OG.rst b/doc/api/next_api_changes/behavior/27514-OG.rst deleted file mode 100644 index 8b2a7ab9ef2e..000000000000 --- a/doc/api/next_api_changes/behavior/27514-OG.rst +++ /dev/null @@ -1,5 +0,0 @@ -Exception when not passing a Bbox to BboxTransform*-classes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The exception when not passing a Bbox to BboxTransform*-classes that expect one, e.g., -`~matplotlib.transforms.BboxTransform` has changed from ``ValueError`` to ``TypeError``. diff --git a/doc/api/next_api_changes/behavior/27589-DS.rst b/doc/api/next_api_changes/behavior/27589-DS.rst deleted file mode 100644 index 314df582600b..000000000000 --- a/doc/api/next_api_changes/behavior/27589-DS.rst +++ /dev/null @@ -1,5 +0,0 @@ -PowerNorm no longer clips values below vmin -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When ``clip=False`` is set (the default) on `~matplotlib.colors.PowerNorm`, -values below ``vmin`` are now linearly normalised. Previously they were clipped -to zero. This fixes issues with the display of colorbars associated with a power norm. diff --git a/doc/api/next_api_changes/behavior/27605-DS.rst b/doc/api/next_api_changes/behavior/27605-DS.rst deleted file mode 100644 index a4bc04ccfb04..000000000000 --- a/doc/api/next_api_changes/behavior/27605-DS.rst +++ /dev/null @@ -1,4 +0,0 @@ -Boxplots now ignore masked data points -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -`~matplotlib.axes.Axes.boxplot` and `~matplotlib.cbook.boxplot_stats` now ignore -any masked points in the input data. diff --git a/doc/api/next_api_changes/behavior/27767-REC.rst b/doc/api/next_api_changes/behavior/27767-REC.rst deleted file mode 100644 index f6b4dc156732..000000000000 --- a/doc/api/next_api_changes/behavior/27767-REC.rst +++ /dev/null @@ -1,7 +0,0 @@ -Legend labels for ``plot`` -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Previously if a sequence was passed to the *label* parameter of `~.Axes.plot` when -plotting a single dataset, the sequence was automatically cast to string for the legend -label. Now, if the sequence has only one element, that element will be the legend -label. To keep the old behavior, cast the sequence to string before passing. diff --git a/doc/api/next_api_changes/behavior/27943-AL.rst b/doc/api/next_api_changes/behavior/27943-AL.rst deleted file mode 100644 index 1314b763987e..000000000000 --- a/doc/api/next_api_changes/behavior/27943-AL.rst +++ /dev/null @@ -1,10 +0,0 @@ -plot() shorthand format interprets "Cn" (n>9) as a color-cycle color -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Previously, ``plot(..., "-C11")`` would be interpreted as requesting a plot -using linestyle "-", color "C1" (color #1 of the color cycle), and marker "1" -("tri-down"). It is now interpreted as requesting linestyle "-" and color -"C11" (color #11 of the color cycle). - -It is recommended to pass ambiguous markers (such as "1") explicitly using the -*marker* keyword argument. If the shorthand form is desired, such markers can -also be unambiguously set by putting them *before* the color string. diff --git a/doc/api/next_api_changes/deprecations/24834-DS.rst b/doc/api/next_api_changes/deprecations/24834-DS.rst deleted file mode 100644 index 3761daaf1275..000000000000 --- a/doc/api/next_api_changes/deprecations/24834-DS.rst +++ /dev/null @@ -1,17 +0,0 @@ -Applying theta transforms in ``PolarTransform`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Applying theta transforms in `~matplotlib.projections.polar.PolarTransform` -and `~matplotlib.projections.polar.InvertedPolarTransform` -is deprecated, and will be removed in a future version of Matplotlib. This -is currently the default behaviour when these transforms are used externally, -but only takes affect when: - -- An axis is associated with the transform. -- The axis has a non-zero theta offset or has theta values increasing in - a clockwise direction. - -To silence this warning and adopt future behaviour, -set ``apply_theta_transforms=False``. If you need to retain the behaviour -where theta values are transformed, chain the ``PolarTransform`` with -a `~matplotlib.transforms.Affine2D` transform that performs the theta shift -and/or sign shift. diff --git a/doc/api/next_api_changes/deprecations/26894-AL.rst b/doc/api/next_api_changes/deprecations/26894-AL.rst deleted file mode 100644 index b156fa843917..000000000000 --- a/doc/api/next_api_changes/deprecations/26894-AL.rst +++ /dev/null @@ -1,6 +0,0 @@ -*interval* parameter of ``TimerBase.start`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Setting the timer *interval* while starting it is deprecated. The interval can -be specified instead in the timer constructor, or by setting the -``timer.interval`` attribute. diff --git a/doc/api/next_api_changes/deprecations/26917-AL.rst b/doc/api/next_api_changes/deprecations/26917-AL.rst deleted file mode 100644 index d3cf16f5c511..000000000000 --- a/doc/api/next_api_changes/deprecations/26917-AL.rst +++ /dev/null @@ -1,3 +0,0 @@ -``ContourLabeler.add_label_clabeltext`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... is deprecated. diff --git a/doc/api/next_api_changes/deprecations/26960-AL.rst b/doc/api/next_api_changes/deprecations/26960-AL.rst deleted file mode 100644 index cbde4cbba424..000000000000 --- a/doc/api/next_api_changes/deprecations/26960-AL.rst +++ /dev/null @@ -1,3 +0,0 @@ -``backend_ps.get_bbox_header`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... is deprecated, as it is considered an internal helper. diff --git a/doc/api/next_api_changes/deprecations/27088-JK.rst b/doc/api/next_api_changes/deprecations/27088-JK.rst deleted file mode 100644 index ea7fef5abf64..000000000000 --- a/doc/api/next_api_changes/deprecations/27088-JK.rst +++ /dev/null @@ -1,5 +0,0 @@ -Deprecations removed in ``contour`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``contour.allsegs``, ``contour.allkinds``, and ``contour.find_nearest_contour`` are no -longer marked for deprecation. diff --git a/doc/api/next_api_changes/deprecations/27095-AL.rst b/doc/api/next_api_changes/deprecations/27095-AL.rst deleted file mode 100644 index 2e5b2e1ea5e5..000000000000 --- a/doc/api/next_api_changes/deprecations/27095-AL.rst +++ /dev/null @@ -1,10 +0,0 @@ -*nth_coord* parameter to axisartist helpers for fixed axis -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Helper APIs in `.axisartist` for generating a "fixed" axis on rectilinear axes -(`.FixedAxisArtistHelperRectilinear`) no longer take a *nth_coord* parameter, -as that parameter is entirely inferred from the (required) *loc* parameter and -having inconsistent *nth_coord* and *loc* is an error. - -For curvilinear axes, the *nth_coord* parameter remains supported (it affects -the *ticks*, not the axis position itself), but that parameter will become -keyword-only, for consistency with the rectilinear case. diff --git a/doc/api/next_api_changes/deprecations/27175-AL.rst b/doc/api/next_api_changes/deprecations/27175-AL.rst deleted file mode 100644 index 3fce05765a59..000000000000 --- a/doc/api/next_api_changes/deprecations/27175-AL.rst +++ /dev/null @@ -1,5 +0,0 @@ -Mixing positional and keyword arguments for ``legend`` handles and labels -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This previously only raised a warning, but is now formally deprecated. If -passing *handles* and *labels*, they must be passed either both positionally or -both as keyword. diff --git a/doc/api/next_api_changes/deprecations/27300-AL.rst b/doc/api/next_api_changes/deprecations/27300-AL.rst deleted file mode 100644 index 87f4bb259537..000000000000 --- a/doc/api/next_api_changes/deprecations/27300-AL.rst +++ /dev/null @@ -1,3 +0,0 @@ -``GridHelperCurveLinear.get_tick_iterator`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... is deprecated with no replacement. diff --git a/doc/api/next_api_changes/deprecations/27513-OG.rst b/doc/api/next_api_changes/deprecations/27513-OG.rst deleted file mode 100644 index 46414744f59d..000000000000 --- a/doc/api/next_api_changes/deprecations/27513-OG.rst +++ /dev/null @@ -1,5 +0,0 @@ -``BboxTransformToMaxOnly`` -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -... is deprecated without replacement. If you rely on this, please make a copy of the -code. diff --git a/doc/api/next_api_changes/deprecations/27514-OG.rst b/doc/api/next_api_changes/deprecations/27514-OG.rst deleted file mode 100644 index f318ec8aa4bb..000000000000 --- a/doc/api/next_api_changes/deprecations/27514-OG.rst +++ /dev/null @@ -1,4 +0,0 @@ -``TransformNode.is_bbox`` -~~~~~~~~~~~~~~~~~~~~~~~~~ - -... is deprecated. Instead check the object using ``isinstance(..., BboxBase)``. diff --git a/doc/api/next_api_changes/deprecations/27719-IT.rst b/doc/api/next_api_changes/deprecations/27719-IT.rst deleted file mode 100644 index c41e9d2c396f..000000000000 --- a/doc/api/next_api_changes/deprecations/27719-IT.rst +++ /dev/null @@ -1,11 +0,0 @@ -``rcsetup.interactive_bk``, ``rcsetup.non_interactive_bk`` and ``rcsetup.all_backends`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -... are deprecated and replaced by ``matplotlib.backends.backend_registry.list_builtin`` -with the following arguments - -- ``matplotlib.backends.BackendFilter.INTERACTIVE`` -- ``matplotlib.backends.BackendFilter.NON_INTERACTIVE`` -- ``None`` - -respectively. diff --git a/doc/api/next_api_changes/deprecations/27767-REC.rst b/doc/api/next_api_changes/deprecations/27767-REC.rst deleted file mode 100644 index 68781090df0a..000000000000 --- a/doc/api/next_api_changes/deprecations/27767-REC.rst +++ /dev/null @@ -1,9 +0,0 @@ -Legend labels for ``plot`` -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Previously if a sequence was passed to the *label* parameter of `~.Axes.plot` when -plotting a single dataset, the sequence was automatically cast to string for the legend -label. This behavior is now deprecated and in future will error if the sequence length -is not one (consistent with multi-dataset behavior, where the number of elements must -match the number of datasets). To keep the old behavior, cast the sequence to string -before passing. diff --git a/doc/api/next_api_changes/deprecations/27850-REC.rst b/doc/api/next_api_changes/deprecations/27850-REC.rst deleted file mode 100644 index 2021c2737ecd..000000000000 --- a/doc/api/next_api_changes/deprecations/27850-REC.rst +++ /dev/null @@ -1,10 +0,0 @@ -``plot_date`` -~~~~~~~~~~~~~ - -Use of `~.Axes.plot_date` has been discouraged since Matplotlib 3.5 and the -function is now formally deprecated. - -- ``datetime``-like data should directly be plotted using `~.Axes.plot`. -- If you need to plot plain numeric data as :ref:`date-format` or need to set - a timezone, call ``ax.xaxis.axis_date`` / ``ax.yaxis.axis_date`` before - `~.Axes.plot`. See `.Axis.axis_date`. diff --git a/doc/api/next_api_changes/deprecations/27901-TS.rst b/doc/api/next_api_changes/deprecations/27901-TS.rst deleted file mode 100644 index e31b77e2c6f8..000000000000 --- a/doc/api/next_api_changes/deprecations/27901-TS.rst +++ /dev/null @@ -1,3 +0,0 @@ -``boxplot`` tick labels -~~~~~~~~~~~~~~~~~~~~~~~ -The parameter *labels* has been renamed to *tick_labels* for clarity and consistency with `~.Axes.bar`. diff --git a/doc/api/next_api_changes/development/26800-OG.rst b/doc/api/next_api_changes/development/26800-OG.rst deleted file mode 100644 index d536f8240c76..000000000000 --- a/doc/api/next_api_changes/development/26800-OG.rst +++ /dev/null @@ -1,14 +0,0 @@ -Increase to minimum supported versions of dependencies -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -For Matplotlib 3.9, the :ref:`minimum supported versions ` are -being bumped: - -+------------+-----------------+---------------+ -| Dependency | min in mpl3.8 | min in mpl3.9 | -+============+=================+===============+ -| NumPy | 1.21.0 | 1.23.0 | -+------------+-----------------+---------------+ - -This is consistent with our :ref:`min_deps_policy` and `NEP29 -`__ diff --git a/doc/api/next_api_changes/development/26849-KS.rst b/doc/api/next_api_changes/development/26849-KS.rst deleted file mode 100644 index 1a1deda40fca..000000000000 --- a/doc/api/next_api_changes/development/26849-KS.rst +++ /dev/null @@ -1,5 +0,0 @@ -Minimum version of setuptools bumped to 64 -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To comply with requirements of ``setuptools_scm``, the minimum version of ``setuptools`` -has been increased from 42 to 64. diff --git a/doc/api/next_api_changes/development/27012-ES.rst b/doc/api/next_api_changes/development/27012-ES.rst deleted file mode 100644 index 1bec3e7d91df..000000000000 --- a/doc/api/next_api_changes/development/27012-ES.rst +++ /dev/null @@ -1,7 +0,0 @@ -Extensions require C++17 -~~~~~~~~~~~~~~~~~~~~~~~~ - -Matplotlib now requires a compiler that supports C++17 in order to build its extensions. -According to `SciPy's analysis -`_, this -should be available on all supported platforms. diff --git a/doc/api/next_api_changes/development/27676-ES.rst b/doc/api/next_api_changes/development/27676-ES.rst deleted file mode 100644 index 5242c5cba943..000000000000 --- a/doc/api/next_api_changes/development/27676-ES.rst +++ /dev/null @@ -1,6 +0,0 @@ -Windows on ARM64 support -~~~~~~~~~~~~~~~~~~~~~~~~ - -Windows on ARM64 bundles FreeType 2.6.1 instead of 2.11.1 when building from source. -This may cause small changes to text rendering, but should become consistent with all -other platforms. diff --git a/doc/api/next_api_changes/removals/26797-OG.rst b/doc/api/next_api_changes/removals/26797-OG.rst deleted file mode 100644 index 680f69e01a96..000000000000 --- a/doc/api/next_api_changes/removals/26797-OG.rst +++ /dev/null @@ -1,17 +0,0 @@ -``draw_gouraud_triangle`` -~~~~~~~~~~~~~~~~~~~~~~~~~ - -... is removed. Use `~.RendererBase.draw_gouraud_triangles` instead. - -A ``draw_gouraud_triangle`` call in a custom `~matplotlib.artist.Artist` can readily be -replaced as:: - - self.draw_gouraud_triangles(gc, points.reshape((1, 3, 2)), - colors.reshape((1, 3, 4)), trans) - -A `~.RendererBase.draw_gouraud_triangles` method can be implemented from an -existing ``draw_gouraud_triangle`` method as:: - - transform = transform.frozen() - for tri, col in zip(triangles_array, colors_array): - self.draw_gouraud_triangle(gc, tri, col, transform) diff --git a/doc/api/next_api_changes/removals/26798-OG.rst b/doc/api/next_api_changes/removals/26798-OG.rst deleted file mode 100644 index 0d7d0a11faf2..000000000000 --- a/doc/api/next_api_changes/removals/26798-OG.rst +++ /dev/null @@ -1,9 +0,0 @@ -``unit_cube``, ``tunit_cube``, and ``tunit_edges`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -... of `.Axes3D` are removed without replacements. - -``axes3d.vvec``, ``axes3d.eye``, ``axes3d.sx``, and ``axes3d.sy`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -... are removed without replacement. diff --git a/doc/api/next_api_changes/removals/26852-OG.rst b/doc/api/next_api_changes/removals/26852-OG.rst deleted file mode 100644 index 08ad0105b70a..000000000000 --- a/doc/api/next_api_changes/removals/26852-OG.rst +++ /dev/null @@ -1,12 +0,0 @@ -``num2julian``, ``julian2num`` and ``JULIAN_OFFSET`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -... of the `.dates` module are removed without replacements. These were -undocumented and not exported. - -Julian dates in Matplotlib were calculated from a Julian date epoch: ``jdate = -(date - np.datetime64(EPOCH)) / np.timedelta64(1, 'D')``. Conversely, a Julian -date was converted to datetime as ``date = np.timedelta64(int(jdate * 24 * -3600), 's') + np.datetime64(EPOCH)``. Matplotlib was using -``EPOCH='-4713-11-24T12:00'`` so that 2000-01-01 at 12:00 is 2_451_545.0 (see -`). diff --git a/doc/api/next_api_changes/removals/26853-OG.rst b/doc/api/next_api_changes/removals/26853-OG.rst deleted file mode 100644 index dc5c37e38db5..000000000000 --- a/doc/api/next_api_changes/removals/26853-OG.rst +++ /dev/null @@ -1,26 +0,0 @@ -Most arguments to widgets have been made keyword-only -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Passing all but the very few first arguments positionally in the constructors -of Widgets is now keyword-only. In general, all optional arguments are keyword-only. - -``RadioButtons.circles`` -~~~~~~~~~~~~~~~~~~~~~~~~ - -... is removed. (``RadioButtons`` now draws itself using `~.Axes.scatter`.) - -``CheckButtons.rectangles`` and ``CheckButtons.lines`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``CheckButtons.rectangles`` and ``CheckButtons.lines`` are removed. -(``CheckButtons`` now draws itself using `~.Axes.scatter`.) - -Remove unused parameter *x* to ``TextBox.begin_typing`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This parameter was unused in the method, but was a required argument. - -``MultiCursor.needclear`` -~~~~~~~~~~~~~~~~~~~~~~~~~ - -... is removed. diff --git a/doc/api/next_api_changes/removals/26871-AG.rst b/doc/api/next_api_changes/removals/26871-AG.rst deleted file mode 100644 index 9c24ac3215a1..000000000000 --- a/doc/api/next_api_changes/removals/26871-AG.rst +++ /dev/null @@ -1,3 +0,0 @@ -``matplotlib.axis.Axis.set_ticklabels`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... a param was renamed to labels from ticklabels. diff --git a/doc/api/next_api_changes/removals/26872-AD.rst b/doc/api/next_api_changes/removals/26872-AD.rst deleted file mode 100644 index 411359813e51..000000000000 --- a/doc/api/next_api_changes/removals/26872-AD.rst +++ /dev/null @@ -1,5 +0,0 @@ -``Animation`` attributes -~~~~~~~~~~~~~~~~~~~~~~~~ - -The attributes ``repeat`` of `.TimedAnimation` and subclasses and -``save_count`` of `.FuncAnimation` are considered private and removed. diff --git a/doc/api/next_api_changes/removals/26874-AG.rst b/doc/api/next_api_changes/removals/26874-AG.rst deleted file mode 100644 index ad305cf9d96c..000000000000 --- a/doc/api/next_api_changes/removals/26874-AG.rst +++ /dev/null @@ -1,4 +0,0 @@ -``collections.PolyCollection.span_where`` and ``collections.BrokenBarHCollection`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -... removed as it was deprecated during 3.7. Use ``fill_between`` instead diff --git a/doc/api/next_api_changes/removals/26884-JS.rst b/doc/api/next_api_changes/removals/26884-JS.rst deleted file mode 100644 index 71608b8d94be..000000000000 --- a/doc/api/next_api_changes/removals/26884-JS.rst +++ /dev/null @@ -1,5 +0,0 @@ -``parse_fontconfig_pattern`` raises on unknown constant names -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Previously, in a fontconfig pattern like ``DejaVu Sans:foo``, the unknown -``foo`` constant name would be silently ignored. This now raises an error. diff --git a/doc/api/next_api_changes/removals/26885-AD.rst b/doc/api/next_api_changes/removals/26885-AD.rst deleted file mode 100644 index c617f10d07ed..000000000000 --- a/doc/api/next_api_changes/removals/26885-AD.rst +++ /dev/null @@ -1,4 +0,0 @@ -``raw`` parameter -~~~~~~~~~~~~~~~~~ - -... of `.GridSpecBase.get_grid_positions` is removed without replacements. diff --git a/doc/api/next_api_changes/removals/26889-GC.rst b/doc/api/next_api_changes/removals/26889-GC.rst deleted file mode 100644 index 2cccc9fee113..000000000000 --- a/doc/api/next_api_changes/removals/26889-GC.rst +++ /dev/null @@ -1,3 +0,0 @@ -Removing Deprecated API SimpleEvent -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -``matplotlib.patches.ConnectionStyle._Base.SimpleEvent`` diff --git a/doc/api/next_api_changes/removals/26900-jf.rst b/doc/api/next_api_changes/removals/26900-jf.rst deleted file mode 100644 index 5f14c1543ad8..000000000000 --- a/doc/api/next_api_changes/removals/26900-jf.rst +++ /dev/null @@ -1,4 +0,0 @@ -``passthru_pt`` -~~~~~~~~~~~~~~~ - -This attribute of ``AxisArtistHelper``\s has been removed. diff --git a/doc/api/next_api_changes/removals/26907-DCH.rst b/doc/api/next_api_changes/removals/26907-DCH.rst deleted file mode 100644 index 889743ba9cb0..000000000000 --- a/doc/api/next_api_changes/removals/26907-DCH.rst +++ /dev/null @@ -1,14 +0,0 @@ -``contour.ClabelText`` and ``ContourLabeler.set_label_props`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... are removed. - -Use ``Text(..., transform_rotates_text=True)`` as a replacement for -``contour.ClabelText(...)`` and ``text.set(text=text, color=color, -fontproperties=labeler.labelFontProps, clip_box=labeler.axes.bbox)`` as a -replacement for the ``ContourLabeler.set_label_props(label, text, color)``. - -``ContourLabeler`` attributes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``labelFontProps``, ``labelFontSizeList``, and ``labelTextsList`` -attributes of `.ContourLabeler` have been removed. Use the ``labelTexts`` -attribute and the font properties of the corresponding text objects instead. diff --git a/doc/api/next_api_changes/removals/26909-VV.rst b/doc/api/next_api_changes/removals/26909-VV.rst deleted file mode 100644 index bdb815eed322..000000000000 --- a/doc/api/next_api_changes/removals/26909-VV.rst +++ /dev/null @@ -1,4 +0,0 @@ -``matplotlib.tri`` submodules are removed -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``matplotlib.tri.*`` submodules are removed. All functionality is -available in ``matplotlib.tri`` directly and should be imported from there. diff --git a/doc/api/next_api_changes/removals/26910-JP.rst b/doc/api/next_api_changes/removals/26910-JP.rst deleted file mode 100644 index 0de12cd89ad5..000000000000 --- a/doc/api/next_api_changes/removals/26910-JP.rst +++ /dev/null @@ -1,13 +0,0 @@ -``offsetbox.bbox_artist`` -~~~~~~~~~~~~~~~~~~~~~~~~~ - -... is removed. This was just a wrapper to call `.patches.bbox_artist` if a flag is set in the file, so use that directly if you need the behavior. - -``offsetBox.get_extent_offsets`` and ``offsetBox.get_extent`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -... are removed; these methods are also removed on all subclasses of `.OffsetBox`. - -... To get the offsetbox extents, instead of ``get_extent``, use `.OffsetBox.get_bbox`, which directly returns a `.Bbox` instance. - -... To also get the child offsets, instead of ``get_extent_offsets``, separately call `~.OffsetBox.get_offset` on each children after triggering a draw. diff --git a/doc/api/next_api_changes/removals/26918-EW.rst b/doc/api/next_api_changes/removals/26918-EW.rst deleted file mode 100644 index 454f35d5e200..000000000000 --- a/doc/api/next_api_changes/removals/26918-EW.rst +++ /dev/null @@ -1,3 +0,0 @@ -``Quiver.quiver_doc`` and ``Barbs.barbs_doc`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... are removed. These are the doc-string and should not be accessible as a named class member. diff --git a/doc/api/next_api_changes/removals/26962-IA.rst b/doc/api/next_api_changes/removals/26962-IA.rst deleted file mode 100644 index ac1ab46944b6..000000000000 --- a/doc/api/next_api_changes/removals/26962-IA.rst +++ /dev/null @@ -1,19 +0,0 @@ -Deprecated Classes Removed -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The following deprecated classes from version 3.7 have been removed: - -- ``matplotlib.backends.backend_ps.PsBackendHelper`` -- ``matplotlib.backends.backend_webagg.ServerThread`` - -These classes were previously marked as deprecated and have now been removed in accordance with the deprecation cycle. - -Deprecated C++ Methods Removed -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The following deprecated C++ methods from :file:`src/_backend_agg_wrapper.cpp`, deprecated since version 3.7, have also been removed: - -- ``PyBufferRegion_to_string`` -- ``PyBufferRegion_to_string_argb`` - -These methods were previously marked as deprecated and have now been removed. diff --git a/doc/api/next_api_changes/removals/26965-ER.rst b/doc/api/next_api_changes/removals/26965-ER.rst deleted file mode 100644 index b4ae71be3bff..000000000000 --- a/doc/api/next_api_changes/removals/26965-ER.rst +++ /dev/null @@ -1,22 +0,0 @@ -Removal of top-level cmap registration and access functions in ``mpl.cm`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -As part of the `multi-step refactoring of colormap registration -`_, the following functions have -been removed: - -- ``matplotlib.cm.get_cmap``; use ``matplotlib.colormaps[name]`` instead if you - have a `str`. - - Use `matplotlib.cm.ColormapRegistry.get_cmap` if you have a `str`, `None` or a - `matplotlib.colors.Colormap` object that you want to convert to a `.Colormap` - object. -- ``matplotlib.cm.register_cmap``; use `matplotlib.colormaps.register - <.ColormapRegistry.register>` instead. -- ``matplotlib.cm.unregister_cmap``; use `matplotlib.colormaps.unregister - <.ColormapRegistry.unregister>` instead. -- ``matplotlib.pyplot.register_cmap``; use `matplotlib.colormaps.register - <.ColormapRegistry.register>` instead. - -The `matplotlib.pyplot.get_cmap` function will stay available for backward -compatibility. diff --git a/doc/api/next_api_changes/removals/27095-AL.rst b/doc/api/next_api_changes/removals/27095-AL.rst deleted file mode 100644 index 7b8e5981ca79..000000000000 --- a/doc/api/next_api_changes/removals/27095-AL.rst +++ /dev/null @@ -1,5 +0,0 @@ -Inconsistent *nth_coord* and *loc* passed to ``_FixedAxisArtistHelperBase`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The value of the *nth_coord* parameter of ``_FixedAxisArtistHelperBase`` and -its subclasses is now inferred from the value of *loc*; passing inconsistent -values (e.g., requesting a "top y axis" or a "left x axis") has no more effect. diff --git a/doc/api/next_api_changes/removals/27968-ES.rst b/doc/api/next_api_changes/removals/27968-ES.rst deleted file mode 100644 index 99b3b1527506..000000000000 --- a/doc/api/next_api_changes/removals/27968-ES.rst +++ /dev/null @@ -1,14 +0,0 @@ -``legend.legendHandles`` -~~~~~~~~~~~~~~~~~~~~~~~~ - -... was undocumented and has been renamed to ``legend_handles``. - -Passing undefined *label_mode* to ``Grid`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -... is no longer allowed. This includes `mpl_toolkits.axes_grid1.axes_grid.Grid`, -`mpl_toolkits.axes_grid1.axes_grid.AxesGrid`, and -`mpl_toolkits.axes_grid1.axes_grid.ImageGrid` as well as the corresponding classes -imported from `mpl_toolkits.axisartist.axes_grid`. - -Pass ``label_mode='keep'`` instead to get the previous behavior of not modifying labels. diff --git a/doc/api/prev_api_changes/api_changes_3.9.0.rst b/doc/api/prev_api_changes/api_changes_3.9.0.rst new file mode 100644 index 000000000000..8bd2628c90dc --- /dev/null +++ b/doc/api/prev_api_changes/api_changes_3.9.0.rst @@ -0,0 +1,14 @@ +API Changes for 3.9.0 +===================== + +.. contents:: + :local: + :depth: 1 + +.. include:: /api/prev_api_changes/api_changes_3.9.0/behaviour.rst + +.. include:: /api/prev_api_changes/api_changes_3.9.0/deprecations.rst + +.. include:: /api/prev_api_changes/api_changes_3.9.0/removals.rst + +.. include:: /api/prev_api_changes/api_changes_3.9.0/development.rst diff --git a/doc/api/prev_api_changes/api_changes_3.9.0/behaviour.rst b/doc/api/prev_api_changes/api_changes_3.9.0/behaviour.rst new file mode 100644 index 000000000000..498dfb766922 --- /dev/null +++ b/doc/api/prev_api_changes/api_changes_3.9.0/behaviour.rst @@ -0,0 +1,120 @@ +Behaviour Changes +----------------- + +plot() shorthand format interprets "Cn" (n>9) as a color-cycle color +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Previously, ``plot(..., "-C11")`` would be interpreted as requesting a plot using +linestyle "-", color "C1" (color #1 of the color cycle), and marker "1" ("tri-down"). +It is now interpreted as requesting linestyle "-" and color "C11" (color #11 of the +color cycle). + +It is recommended to pass ambiguous markers (such as "1") explicitly using the *marker* +keyword argument. If the shorthand form is desired, such markers can also be +unambiguously set by putting them *before* the color string. + +Legend labels for ``plot`` +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Previously if a sequence was passed to the *label* parameter of `~.Axes.plot` when +plotting a single dataset, the sequence was automatically cast to string for the legend +label. Now, if the sequence has only one element, that element will be the legend label. +To keep the old behavior, cast the sequence to string before passing. + +Boxplots now ignore masked data points +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +`~matplotlib.axes.Axes.boxplot` and `~matplotlib.cbook.boxplot_stats` now ignore any +masked points in the input data. + +``axhspan`` and ``axvspan`` now return ``Rectangle``\s, not ``Polygon``\s +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This change allows using `~.Axes.axhspan` to draw an annulus on polar axes. + +This change also affects other elements built via `~.Axes.axhspan` and `~.Axes.axvspan`, +such as ``Slider.poly``. + +Improved handling of pan/zoom events of overlapping Axes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The forwarding of pan/zoom events is now determined by the visibility of the +background-patch (e.g. ``ax.patch.get_visible()``) and by the ``zorder`` of the axes. + +- Axes with a visible patch capture the event and do not pass it on to axes below. Only + the Axes with the highest ``zorder`` that contains the event is triggered (if there + are multiple Axes with the same ``zorder``, the last added Axes counts) +- Axes with an invisible patch are also invisible to events and they are passed on to + the axes below. + +To override the default behavior and explicitly set whether an Axes should forward +navigation events, use `.Axes.set_forward_navigation_events`. + +``loc='best'`` for ``legend`` now considers ``Text`` and ``PolyCollections`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The location selection ``legend`` now considers the existence of ``Text`` and +``PolyCollections`` in the ``badness`` calculation. + +Note: The ``best`` option can already be quite slow for plots with large amounts of +data. For ``PolyCollections``, it only considers the ``Path`` of ``PolyCollections`` and +not the enclosed area when checking for overlap to reduce additional latency. However, +it can still be quite slow when there are large amounts of ``PolyCollections`` in the +plot to check for. + +Exception when not passing a Bbox to BboxTransform*-classes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The exception when not passing a Bbox to BboxTransform*-classes that expect one, e.g., +`~matplotlib.transforms.BboxTransform` has changed from ``ValueError`` to ``TypeError``. + +*loc* parameter of ``Cell`` no longer accepts ``None`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The default value of the *loc* parameter has been changed from ``None`` to ``right``, +which already was the default location. The behavior of `.Cell` didn't change when +called without an explicit *loc* parameter. + +``ContourLabeler.add_label`` now respects *use_clabeltext* +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +... and sets `.Text.set_transform_rotates_text` accordingly. + +``Line2D`` +^^^^^^^^^^ + +When creating a Line2D or using `.Line2D.set_xdata` and `.Line2D.set_ydata`, +passing x/y data as non sequence is now an error. + +``ScalarMappable``\s auto-scale their norm when an array is set +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Collections previously deferred auto-scaling of the norm until draw time. This has been +changed to scale the norm whenever the first array is set to align with the docstring +and reduce unexpected behavior when accessing the norm before drawing. + +``SubplotParams`` moved from ``matplotlib.figure`` to ``matplotlib.gridspec`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +It is still importable from ``matplotlib.figure``, so does not require any changes to +existing code. + +``PowerNorm`` no longer clips values below vmin +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When ``clip=False`` is set (the default) on `~matplotlib.colors.PowerNorm`, values below +``vmin`` are now linearly normalised. Previously they were clipped to zero. This fixes +issues with the display of colorbars associated with a power norm. + +Image path semantics of toolmanager-based tools +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Previously, MEP22 ("toolmanager-based") Tools would try to load their icon +(``tool.image``) relative to the current working directory, or, as a fallback, from +Matplotlib's own image directory. Because both approaches are problematic for +third-party tools (the end-user may change the current working directory at any time, +and third-parties cannot add new icons in Matplotlib's image directory), this behavior +is deprecated; instead, ``tool.image`` is now interpreted relative to the directory +containing the source file where the ``Tool.image`` class attribute is defined. +(Defining ``tool.image`` as an absolute path also works and is compatible with both the +old and the new semantics.) diff --git a/doc/api/prev_api_changes/api_changes_3.9.0/deprecations.rst b/doc/api/prev_api_changes/api_changes_3.9.0/deprecations.rst new file mode 100644 index 000000000000..00469459d20a --- /dev/null +++ b/doc/api/prev_api_changes/api_changes_3.9.0/deprecations.rst @@ -0,0 +1,93 @@ +Deprecations +------------ + +``plot_date`` +^^^^^^^^^^^^^ + +Use of `~.Axes.plot_date` has been discouraged since Matplotlib 3.5 and the function is +now formally deprecated. + +- ``datetime``-like data should directly be plotted using `~.Axes.plot`. +- If you need to plot plain numeric data as :ref:`date-format` or need to set a + timezone, call ``ax.xaxis.axis_date`` / ``ax.yaxis.axis_date`` before `~.Axes.plot`. + See `.Axis.axis_date`. + +Legend labels for ``plot`` +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Previously if a sequence was passed to the *label* parameter of `~.Axes.plot` when +plotting a single dataset, the sequence was automatically cast to string for the legend +label. This behavior is now deprecated and in future will error if the sequence length +is not one (consistent with multi-dataset behavior, where the number of elements must +match the number of datasets). To keep the old behavior, cast the sequence to string +before passing. + +``boxplot`` tick labels +^^^^^^^^^^^^^^^^^^^^^^^ + +The parameter *labels* has been renamed to *tick_labels* for clarity and consistency +with `~.Axes.bar`. + +Mixing positional and keyword arguments for ``legend`` handles and labels +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This previously only raised a warning, but is now formally deprecated. If passing +*handles* and *labels*, they must be passed either both positionally or both as keyword. + +Applying theta transforms in ``PolarTransform`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Applying theta transforms in `~matplotlib.projections.polar.PolarTransform` and +`~matplotlib.projections.polar.InvertedPolarTransform` is deprecated, and will be +removed in a future version of Matplotlib. This is currently the default behaviour when +these transforms are used externally, but only takes affect when: + +- An axis is associated with the transform. +- The axis has a non-zero theta offset or has theta values increasing in a clockwise + direction. + +To silence this warning and adopt future behaviour, set +``apply_theta_transforms=False``. If you need to retain the behaviour where theta values +are transformed, chain the ``PolarTransform`` with a `~matplotlib.transforms.Affine2D` +transform that performs the theta shift and/or sign shift. + +*interval* parameter of ``TimerBase.start`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Setting the timer *interval* while starting it is deprecated. The interval can be +specified instead in the timer constructor, or by setting the ``timer.interval`` +attribute. + +*nth_coord* parameter to axisartist helpers for fixed axis +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Helper APIs in `.axisartist` for generating a "fixed" axis on rectilinear axes +(`.FixedAxisArtistHelperRectilinear`) no longer take a *nth_coord* parameter, as that +parameter is entirely inferred from the (required) *loc* parameter and having +inconsistent *nth_coord* and *loc* is an error. + +For curvilinear axes, the *nth_coord* parameter remains supported (it affects the +*ticks*, not the axis position itself), but that parameter will become keyword-only, for +consistency with the rectilinear case. + +``rcsetup.interactive_bk``, ``rcsetup.non_interactive_bk`` and ``rcsetup.all_backends`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +... are deprecated and replaced by ``matplotlib.backends.backend_registry.list_builtin`` +with the following arguments + +- ``matplotlib.backends.BackendFilter.INTERACTIVE`` +- ``matplotlib.backends.BackendFilter.NON_INTERACTIVE`` +- ``None`` + +respectively. + +Miscellaneous deprecations +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- ``backend_ps.get_bbox_header`` is considered an internal helper +- ``BboxTransformToMaxOnly``; if you rely on this, please make a copy of the code +- ``ContourLabeler.add_label_clabeltext`` +- ``TransformNode.is_bbox``; instead check the object using ``isinstance(..., + BboxBase)`` +- ``GridHelperCurveLinear.get_tick_iterator`` diff --git a/doc/api/next_api_changes/development/26621-ES.rst b/doc/api/prev_api_changes/api_changes_3.9.0/development.rst similarity index 60% rename from doc/api/next_api_changes/development/26621-ES.rst rename to doc/api/prev_api_changes/api_changes_3.9.0/development.rst index ff87f53b3573..c16e8e98ecc4 100644 --- a/doc/api/next_api_changes/development/26621-ES.rst +++ b/doc/api/prev_api_changes/api_changes_3.9.0/development.rst @@ -1,5 +1,8 @@ +Development changes +------------------- + Build system ported to Meson -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The build system of Matplotlib has been ported from setuptools to `meson-python `_ and `Meson `_. @@ -26,7 +29,7 @@ Consequently, there have been a few changes for development and packaging purpos may be replaced by passing the following arguments to ``pip``:: - --config-settings=setup-args="-DrcParams-backend=Agg" \ + --config-settings=setup-args="-DrcParams-backend=Agg" --config-settings=setup-args="-Dsystem-qhull=true" Note that you must use ``pip`` >= 23.1 in order to pass more than one setting. @@ -37,10 +40,45 @@ Consequently, there have been a few changes for development and packaging purpos `_ if you wish to change the priority of chosen compilers. 5. Installation of test data was previously controlled by :file:`mplsetup.cfg`, but has - now been moved to Meson's install tags. To install test data, add the ``tests`` - tag to the requested install (be sure to include the existing tags as below):: + now been moved to Meson's install tags. To install test data, add the ``tests`` tag + to the requested install (be sure to include the existing tags as below):: --config-settings=install-args="--tags=data,python-runtime,runtime,tests" 6. Checking typing stubs with ``stubtest`` does not work easily with editable install. For the time being, we suggest using a normal (non-editable) install if you wish to run ``stubtest``. + +Increase to minimum supported versions of dependencies +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +For Matplotlib 3.9, the :ref:`minimum supported versions ` are being +bumped: + ++------------+-----------------+---------------+ +| Dependency | min in mpl3.8 | min in mpl3.9 | ++============+=================+===============+ +| NumPy | 1.21.0 | 1.23.0 | ++------------+-----------------+---------------+ +| setuptools | 42 | 64 | ++------------+-----------------+---------------+ + +This is consistent with our :ref:`min_deps_policy` and `SPEC 0 +`__. + +To comply with requirements of ``setuptools_scm``, the minimum version of ``setuptools`` +has been increased from 42 to 64. + +Extensions require C++17 +^^^^^^^^^^^^^^^^^^^^^^^^ + +Matplotlib now requires a compiler that supports C++17 in order to build its extensions. +According to `SciPy's analysis +`_, this +should be available on all supported platforms. + +Windows on ARM64 support +^^^^^^^^^^^^^^^^^^^^^^^^ + +Windows on ARM64 now bundles FreeType 2.6.1 instead of 2.11.1 when building from source. +This may cause small changes to text rendering, but should become consistent with all +other platforms. diff --git a/doc/api/prev_api_changes/api_changes_3.9.0/removals.rst b/doc/api/prev_api_changes/api_changes_3.9.0/removals.rst new file mode 100644 index 000000000000..b9aa03cfbf92 --- /dev/null +++ b/doc/api/prev_api_changes/api_changes_3.9.0/removals.rst @@ -0,0 +1,159 @@ +Removals +-------- + +Top-level cmap registration and access functions in ``mpl.cm`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +As part of the `multi-step refactoring of colormap registration +`_, the following functions have +been removed: + +- ``matplotlib.cm.get_cmap``; use ``matplotlib.colormaps[name]`` instead if you have a + `str`. + + Use `matplotlib.cm.ColormapRegistry.get_cmap` if you have a `str`, `None` or a + `matplotlib.colors.Colormap` object that you want to convert to a `.Colormap` object. +- ``matplotlib.cm.register_cmap``; use `matplotlib.colormaps.register + <.ColormapRegistry.register>` instead. +- ``matplotlib.cm.unregister_cmap``; use `matplotlib.colormaps.unregister + <.ColormapRegistry.unregister>` instead. +- ``matplotlib.pyplot.register_cmap``; use `matplotlib.colormaps.register + <.ColormapRegistry.register>` instead. + +The `matplotlib.pyplot.get_cmap` function will stay available for backward +compatibility. + +Contour labels +^^^^^^^^^^^^^^ + +``contour.ClabelText`` and ``ContourLabeler.set_label_props`` are removed. Use +``Text(..., transform_rotates_text=True)`` as a replacement for +``contour.ClabelText(...)`` and ``text.set(text=text, color=color, +fontproperties=labeler.labelFontProps, clip_box=labeler.axes.bbox)`` as a replacement +for the ``ContourLabeler.set_label_props(label, text, color)``. + +The ``labelFontProps``, ``labelFontSizeList``, and ``labelTextsList`` attributes of +`.ContourLabeler` have been removed. Use the ``labelTexts`` attribute and the font +properties of the corresponding text objects instead. + +``num2julian``, ``julian2num`` and ``JULIAN_OFFSET`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +... of the `.dates` module are removed without replacements. These were undocumented and +not exported. + +Julian dates in Matplotlib were calculated from a Julian date epoch: ``jdate = (date - +np.datetime64(EPOCH)) / np.timedelta64(1, 'D')``. Conversely, a Julian date was +converted to datetime as ``date = np.timedelta64(int(jdate * 24 * 3600), 's') + +np.datetime64(EPOCH)``. Matplotlib was using ``EPOCH='-4713-11-24T12:00'`` so that +2000-01-01 at 12:00 is 2_451_545.0 (see https://en.wikipedia.org/wiki/Julian_day). + +``offsetbox`` methods +^^^^^^^^^^^^^^^^^^^^^ + +``offsetbox.bbox_artist`` is removed. This was just a wrapper to call +`.patches.bbox_artist` if a flag is set in the file, so use that directly if you need +the behavior. + +``OffsetBox.get_extent_offsets`` and ``OffsetBox.get_extent`` are removed; these methods +are also removed on all subclasses of `.OffsetBox`. To get the offsetbox extents, +instead of ``get_extent``, use `.OffsetBox.get_bbox`, which directly returns a `.Bbox` +instance. To also get the child offsets, instead of ``get_extent_offsets``, separately +call `~.OffsetBox.get_offset` on each children after triggering a draw. + +``parse_fontconfig_pattern`` raises on unknown constant names +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Previously, in a fontconfig pattern like ``DejaVu Sans:foo``, the unknown ``foo`` +constant name would be silently ignored. This now raises an error. + +``tri`` submodules +^^^^^^^^^^^^^^^^^^ + +The ``matplotlib.tri.*`` submodules are removed. All functionality is available in +``matplotlib.tri`` directly and should be imported from there. + +Widget API +^^^^^^^^^^ + +- ``CheckButtons.rectangles`` and ``CheckButtons.lines`` are removed; `.CheckButtons` + now draws itself using `~.Axes.scatter`. +- ``RadioButtons.circles`` is removed; `.RadioButtons` now draws itself using + `~.Axes.scatter`. +- ``MultiCursor.needclear`` is removed with no replacement. +- The unused parameter *x* to ``TextBox.begin_typing`` was a required argument, and is + now removed. + +Most arguments to widgets have been made keyword-only +""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Passing all but the very few first arguments positionally in the constructors of Widgets +is now keyword-only. In general, all optional arguments are keyword-only. + +``Axes3D`` API +^^^^^^^^^^^^^^ + +- ``Axes3D.unit_cube``, ``Axes3D.tunit_cube``, and ``Axes3D.tunit_edges`` are removed + without replacement. +- ``axes3d.vvec``, ``axes3d.eye``, ``axes3d.sx``, and ``axes3d.sy`` are removed without + replacement. + +Inconsistent *nth_coord* and *loc* passed to ``_FixedAxisArtistHelperBase`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The value of the *nth_coord* parameter of ``_FixedAxisArtistHelperBase`` and its +subclasses is now inferred from the value of *loc*; passing inconsistent values (e.g., +requesting a "top y axis" or a "left x axis") has no more effect. + +Passing undefined *label_mode* to ``Grid`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +... is no longer allowed. This includes `mpl_toolkits.axes_grid1.axes_grid.Grid`, +`mpl_toolkits.axes_grid1.axes_grid.AxesGrid`, and +`mpl_toolkits.axes_grid1.axes_grid.ImageGrid` as well as the corresponding classes +imported from `mpl_toolkits.axisartist.axes_grid`. + +Pass ``label_mode='keep'`` instead to get the previous behavior of not modifying labels. + +``draw_gouraud_triangle`` +^^^^^^^^^^^^^^^^^^^^^^^^^ + +... is removed. Use `~.RendererBase.draw_gouraud_triangles` instead. + +A ``draw_gouraud_triangle`` call in a custom `~matplotlib.artist.Artist` can readily be +replaced as:: + + self.draw_gouraud_triangles(gc, points.reshape((1, 3, 2)), + colors.reshape((1, 3, 4)), trans) + +A `~.RendererBase.draw_gouraud_triangles` method can be implemented from an +existing ``draw_gouraud_triangle`` method as:: + + transform = transform.frozen() + for tri, col in zip(triangles_array, colors_array): + self.draw_gouraud_triangle(gc, tri, col, transform) + +Miscellaneous removals +^^^^^^^^^^^^^^^^^^^^^^ + +The following items have previously been replaced, and are now removed: + +- *ticklabels* parameter of ``matplotlib.axis.Axis.set_ticklabels`` has been renamed to + *labels*. +- ``Barbs.barbs_doc`` and ``Quiver.quiver_doc`` are removed. These are the doc-strings + and should not be accessible as a named class member, but as normal doc-strings would. +- ``collections.PolyCollection.span_where`` and ``collections.BrokenBarHCollection``; + use ``fill_between`` instead. +- ``Legend.legendHandles`` was undocumented and has been renamed to ``legend_handles``. + +The following items have been removed without replacements: + +- The attributes ``repeat`` of `.TimedAnimation` and subclasses and ``save_count`` of + `.FuncAnimation` are considered private and removed. +- ``matplotlib.backend.backend_agg.BufferRegion.to_string`` +- ``matplotlib.backend.backend_agg.BufferRegion.to_string_argb`` +- ``matplotlib.backends.backend_ps.PsBackendHelper`` +- ``matplotlib.backends.backend_webagg.ServerThread`` +- *raw* parameter of `.GridSpecBase.get_grid_positions` +- ``matplotlib.patches.ConnectionStyle._Base.SimpleEvent`` +- ``passthru_pt`` attribute of ``mpl_toolkits.axisartist.AxisArtistHelper`` diff --git a/doc/users/next_whats_new/3d_axis_limits.rst b/doc/users/next_whats_new/3d_axis_limits.rst deleted file mode 100644 index b460cfdb4f73..000000000000 --- a/doc/users/next_whats_new/3d_axis_limits.rst +++ /dev/null @@ -1,20 +0,0 @@ -Setting 3D axis limits now set the limits exactly -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Previously, setting the limits of a 3D axis would always add a small margin to -the limits. Limits are now set exactly by default. The newly introduced rcparam -``axes3d.automargin`` can be used to revert to the old behavior where margin is -automatically added. - -.. plot:: - :include-source: true - :alt: Example of the new behavior of 3D axis limits, and how setting the rcparam reverts to the old behavior. - - import matplotlib.pyplot as plt - fig, axs = plt.subplots(1, 2, subplot_kw={'projection': '3d'}) - - plt.rcParams['axes3d.automargin'] = True - axs[0].set(xlim=(0, 1), ylim=(0, 1), zlim=(0, 1), title='Old Behavior') - - plt.rcParams['axes3d.automargin'] = False # the default in 3.9.0 - axs[1].set(xlim=(0, 1), ylim=(0, 1), zlim=(0, 1), title='New Behavior') diff --git a/doc/users/next_whats_new/add_EllipseCollection_setters.rst b/doc/users/next_whats_new/add_EllipseCollection_setters.rst deleted file mode 100644 index d3f7b3d85f15..000000000000 --- a/doc/users/next_whats_new/add_EllipseCollection_setters.rst +++ /dev/null @@ -1,40 +0,0 @@ -Add ``widths``, ``heights`` and ``angles`` setter to ``EllipseCollection`` --------------------------------------------------------------------------- - -The ``widths``, ``heights`` and ``angles`` values of the `~matplotlib.collections.EllipseCollection` -can now be changed after the collection has been created. - -.. plot:: - :include-source: true - - import matplotlib.pyplot as plt - from matplotlib.collections import EllipseCollection - import numpy as np - - rng = np.random.default_rng(0) - - widths = (2, ) - heights = (3, ) - angles = (45, ) - offsets = rng.random((10, 2)) * 10 - - fig, ax = plt.subplots() - - ec = EllipseCollection( - widths=widths, - heights=heights, - angles=angles, - offsets=offsets, - units='x', - offset_transform=ax.transData, - ) - - ax.add_collection(ec) - ax.set_xlim(-2, 12) - ax.set_ylim(-2, 12) - - new_widths = rng.random((10, 2)) * 2 - new_heights = rng.random((10, 2)) * 3 - new_angles = rng.random((10, 2)) * 180 - - ec.set(widths=new_widths, heights=new_heights, angles=new_angles) diff --git a/doc/users/next_whats_new/axis_minorticks_toggle.rst b/doc/users/next_whats_new/axis_minorticks_toggle.rst deleted file mode 100644 index bb6545e5cb4c..000000000000 --- a/doc/users/next_whats_new/axis_minorticks_toggle.rst +++ /dev/null @@ -1,6 +0,0 @@ -Toggle minorticks on Axis ------------------------------- - -Minor ticks on an `~matplotlib.axis.Axis` can be displayed or removed using -`~matplotlib.axis.Axis.minorticks_on` and `~matplotlib.axis.Axis.minorticks_off`; -e.g.: ``ax.xaxis.minorticks_on()``. See also `~matplotlib.axes.Axes.minorticks_on`. diff --git a/doc/users/next_whats_new/backend_registry.rst b/doc/users/next_whats_new/backend_registry.rst deleted file mode 100644 index 7632c978f9c5..000000000000 --- a/doc/users/next_whats_new/backend_registry.rst +++ /dev/null @@ -1,17 +0,0 @@ -BackendRegistry -~~~~~~~~~~~~~~~ - -New :class:`~matplotlib.backends.registry.BackendRegistry` class is the single -source of truth for available backends. The singleton instance is -``matplotlib.backends.backend_registry``. It is used internally by Matplotlib, -and also IPython (and therefore Jupyter) starting with IPython 8.24.0. - -There are three sources of backends: built-in (source code is within the -Matplotlib repository), explicit ``module://some.backend`` syntax (backend is -obtained by loading the module), or via an entry point (self-registering -backend in an external package). - -To obtain a list of all registered backends use: - - >>> from matplotlib.backends import backend_registry - >>> backend_registry.list_all() diff --git a/doc/users/next_whats_new/boxplot_legend_support.rst b/doc/users/next_whats_new/boxplot_legend_support.rst deleted file mode 100644 index 44802960d9bb..000000000000 --- a/doc/users/next_whats_new/boxplot_legend_support.rst +++ /dev/null @@ -1,60 +0,0 @@ -Legend support for Boxplot -~~~~~~~~~~~~~~~~~~~~~~~~~~ -Boxplots now support a *label* parameter to create legend entries. - -Legend labels can be passed as a list of strings to label multiple boxes in a single -`.Axes.boxplot` call: - - -.. plot:: - :include-source: true - :alt: Example of creating 3 boxplots and assigning legend labels as a sequence. - - import matplotlib.pyplot as plt - import numpy as np - - np.random.seed(19680801) - fruit_weights = [ - np.random.normal(130, 10, size=100), - np.random.normal(125, 20, size=100), - np.random.normal(120, 30, size=100), - ] - labels = ['peaches', 'oranges', 'tomatoes'] - colors = ['peachpuff', 'orange', 'tomato'] - - fig, ax = plt.subplots() - ax.set_ylabel('fruit weight (g)') - - bplot = ax.boxplot(fruit_weights, - patch_artist=True, # fill with color - label=labels) - - # fill with colors - for patch, color in zip(bplot['boxes'], colors): - patch.set_facecolor(color) - - ax.set_xticks([]) - ax.legend() - - -Or as a single string to each individual `.Axes.boxplot`: - -.. plot:: - :include-source: true - :alt: Example of creating 2 boxplots and assigning each legend label as a string. - - import matplotlib.pyplot as plt - import numpy as np - - fig, ax = plt.subplots() - - data_A = np.random.random((100, 3)) - data_B = np.random.random((100, 3)) + 0.2 - pos = np.arange(3) - - ax.boxplot(data_A, positions=pos - 0.2, patch_artist=True, label='Box A', - boxprops={'facecolor': 'steelblue'}) - ax.boxplot(data_B, positions=pos + 0.2, patch_artist=True, label='Box B', - boxprops={'facecolor': 'lightblue'}) - - ax.legend() diff --git a/doc/users/next_whats_new/figure_align_titles.rst b/doc/users/next_whats_new/figure_align_titles.rst deleted file mode 100644 index 230e5f0a8990..000000000000 --- a/doc/users/next_whats_new/figure_align_titles.rst +++ /dev/null @@ -1,7 +0,0 @@ -subplot titles can now be automatically aligned ------------------------------------------------ - -Subplot axes titles can be misaligned vertically if tick labels or -xlabels are placed at the top of one subplot. The new method on the -`.Figure` class: `.Figure.align_titles` will now align the titles -vertically. diff --git a/doc/users/next_whats_new/formatter_unicode_minus.rst b/doc/users/next_whats_new/formatter_unicode_minus.rst deleted file mode 100644 index 1b12b216240e..000000000000 --- a/doc/users/next_whats_new/formatter_unicode_minus.rst +++ /dev/null @@ -1,4 +0,0 @@ -``StrMethodFormatter`` now respects ``axes.unicode_minus`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When formatting negative values, `.StrMethodFormatter` will now use unicode -minus signs if :rc:`axes.unicode_minus` is set. diff --git a/doc/users/next_whats_new/inset_axes.rst b/doc/users/next_whats_new/inset_axes.rst deleted file mode 100644 index d283dfc91b30..000000000000 --- a/doc/users/next_whats_new/inset_axes.rst +++ /dev/null @@ -1,4 +0,0 @@ -``Axes.inset_axes`` is no longer experimental -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Axes.inset_axes is considered stable for use. diff --git a/doc/users/next_whats_new/interpolation_stage_rc.rst b/doc/users/next_whats_new/interpolation_stage_rc.rst deleted file mode 100644 index bd3ecc563e5d..000000000000 --- a/doc/users/next_whats_new/interpolation_stage_rc.rst +++ /dev/null @@ -1,4 +0,0 @@ -``image.interpolation_stage`` rcParam -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This new rcParam controls whether image interpolation occurs in "data" space or -in "rgba" space. diff --git a/doc/users/next_whats_new/margin_getters.rst b/doc/users/next_whats_new/margin_getters.rst deleted file mode 100644 index c43709a17d52..000000000000 --- a/doc/users/next_whats_new/margin_getters.rst +++ /dev/null @@ -1,4 +0,0 @@ -Getters for xmargin, ymargin and zmargin ----------------------------------------- -``.Axes.get_xmargin()``, ``.Axes.get_ymargin()`` and ``.Axes3D.get_zmargin()`` methods have been added to return -the margin values set by ``.Axes.set_xmargin()``, ``.Axes.set_ymargin()`` and ``.Axes3D.set_zmargin()``, respectively. diff --git a/doc/users/next_whats_new/mathtext_documentation.rst b/doc/users/next_whats_new/mathtext_documentation.rst deleted file mode 100644 index 2b7cd51b702c..000000000000 --- a/doc/users/next_whats_new/mathtext_documentation.rst +++ /dev/null @@ -1,5 +0,0 @@ -``mathtext`` documentation improvements ---------------------------------------- - -The documentation is updated to take information directly from the parser. This -means that (almost) all supported symbols, operators etc are shown at :ref:`mathtext`. diff --git a/doc/users/next_whats_new/mathtext_spacing.rst b/doc/users/next_whats_new/mathtext_spacing.rst deleted file mode 100644 index 42da810c3a39..000000000000 --- a/doc/users/next_whats_new/mathtext_spacing.rst +++ /dev/null @@ -1,5 +0,0 @@ -``mathtext`` spacing corrections --------------------------------- - -As consequence of the updated documentation, the spacing on a number of relational and -operator symbols were classified like that and therefore will be spaced properly. diff --git a/doc/users/next_whats_new/nonuniformimage_mousover.rst b/doc/users/next_whats_new/nonuniformimage_mousover.rst deleted file mode 100644 index e5a7ab1bd155..000000000000 --- a/doc/users/next_whats_new/nonuniformimage_mousover.rst +++ /dev/null @@ -1,4 +0,0 @@ -NonUniformImage now has mouseover support ------------------------------------------ -When mousing over a `~matplotlib.image.NonUniformImage` the data values are now -displayed. diff --git a/doc/users/next_whats_new/pie_percent_latex.rst b/doc/users/next_whats_new/pie_percent_latex.rst deleted file mode 100644 index 7ed547302789..000000000000 --- a/doc/users/next_whats_new/pie_percent_latex.rst +++ /dev/null @@ -1,11 +0,0 @@ -Percent sign in pie labels auto-escaped with ``usetex=True`` ------------------------------------------------------------- - -It is common, with `.Axes.pie`, to specify labels that include a percent sign -(``%``), which denotes a comment for LaTeX. When enabling LaTeX with -:rc:`text.usetex` or passing ``textprops={"usetex": True}``, this would cause -the percent sign to disappear. - -Now, the percent sign is automatically escaped (by adding a preceding -backslash) so that it appears regardless of the ``usetex`` setting. If you have -pre-escaped the percent sign, this will be detected, and remain as is. diff --git a/doc/users/next_whats_new/polar-line-spans.rst b/doc/users/next_whats_new/polar-line-spans.rst deleted file mode 100644 index 47bb382dbdbf..000000000000 --- a/doc/users/next_whats_new/polar-line-spans.rst +++ /dev/null @@ -1,5 +0,0 @@ -``axhline`` and ``axhspan`` on polar axes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -... now draw circles and circular arcs (`~.Axes.axhline`) or annuli and wedges -(`~.Axes.axhspan`). diff --git a/doc/users/next_whats_new/sides_violinplot.rst b/doc/users/next_whats_new/sides_violinplot.rst deleted file mode 100644 index f1643de8e322..000000000000 --- a/doc/users/next_whats_new/sides_violinplot.rst +++ /dev/null @@ -1,4 +0,0 @@ -Add option to plot only one half of violin plot -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Setting the parameter *side* to 'low' or 'high' allows to only plot one half of the violin plot. diff --git a/doc/users/next_whats_new/stackplot_hatch.rst b/doc/users/next_whats_new/stackplot_hatch.rst deleted file mode 100644 index 8fd4ca0f81b0..000000000000 --- a/doc/users/next_whats_new/stackplot_hatch.rst +++ /dev/null @@ -1,27 +0,0 @@ -``hatch`` parameter for stackplot -------------------------------------------- - -The `~.Axes.stackplot` *hatch* parameter now accepts a list of strings describing hatching styles that will be applied sequentially to the layers in the stack: - -.. plot:: - :include-source: true - :alt: Two charts, identified as ax1 and ax2, showing "stackplots", i.e. one-dimensional distributions of data stacked on top of one another. The first plot, ax1 has cross-hatching on all slices, having been given a single string as the "hatch" argument. The second plot, ax2 has different styles of hatching on each slice - diagonal hatching in opposite directions on the first two slices, cross-hatching on the third slice, and open circles on the fourth. - - import matplotlib.pyplot as plt - fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(10,5)) - - cols = 10 - rows = 4 - data = ( - np.reshape(np.arange(0, cols, 1), (1, -1)) ** 2 - + np.reshape(np.arange(0, rows), (-1, 1)) - + np.random.random((rows, cols))*5 - ) - x = range(data.shape[1]) - ax1.stackplot(x, data, hatch="x") - ax2.stackplot(x, data, hatch=["//","\\","x","o"]) - - ax1.set_title("hatch='x'") - ax2.set_title("hatch=['//','\\\\','x','o']") - - plt.show() diff --git a/doc/users/next_whats_new/stdfmt-axisartist.rst b/doc/users/next_whats_new/stdfmt-axisartist.rst deleted file mode 100644 index 9cb014413042..000000000000 --- a/doc/users/next_whats_new/stdfmt-axisartist.rst +++ /dev/null @@ -1,3 +0,0 @@ -``axisartist`` can now be used together with standard ``Formatters`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... instead of being limited to axisartist-specific ones. diff --git a/doc/users/next_whats_new/subfigure_zorder.rst b/doc/users/next_whats_new/subfigure_zorder.rst deleted file mode 100644 index a740bbda8eb6..000000000000 --- a/doc/users/next_whats_new/subfigure_zorder.rst +++ /dev/null @@ -1,22 +0,0 @@ -Subfigures have now controllable zorders -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Previously, setting the zorder of a subfigure had no effect, and those were plotted on top of any figure-level artists (i.e for example on top of fig-level legends). Now, subfigures behave like any other artists, and their zorder can be controlled, with default a zorder of 0. - -.. plot:: - :include-source: true - :alt: Example on controlling the zorder of a subfigure - - import matplotlib.pyplot as plt - import numpy as np - x = np.linspace(1, 10, 10) - y1, y2 = x, -x - fig = plt.figure(constrained_layout=True) - subfigs = fig.subfigures(nrows=1, ncols=2) - for subfig in subfigs: - axarr = subfig.subplots(2, 1) - for ax in axarr.flatten(): - (l1,) = ax.plot(x, y1, label="line1") - (l2,) = ax.plot(x, y2, label="line2") - subfigs[0].set_zorder(6) - l = fig.legend(handles=[l1, l2], loc="upper center", ncol=2) diff --git a/doc/users/next_whats_new/update_arrow_patch.rst b/doc/users/next_whats_new/update_arrow_patch.rst deleted file mode 100644 index 894090587b5d..000000000000 --- a/doc/users/next_whats_new/update_arrow_patch.rst +++ /dev/null @@ -1,30 +0,0 @@ -Update the position of arrow patch -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Adds a setter method that allows the user to update the position of the -`.patches.Arrow` object without requiring a full re-draw. - -.. plot:: - :include-source: true - :alt: Example of changing the position of the arrow with the new ``set_data`` method. - - import matplotlib as mpl - import matplotlib.pyplot as plt - from matplotlib.patches import Arrow - import matplotlib.animation as animation - - fig, ax = plt.subplots() - ax.set_xlim(0, 10) - ax.set_ylim(0, 10) - - a = mpl.patches.Arrow(2, 0, 0, 10) - ax.add_patch(a) - - - # code for modifying the arrow - def update(i): - a.set_data(x=.5, dx=i, dy=6, width=2) - - - ani = animation.FuncAnimation(fig, update, frames=15, interval=90, blit=False) - - plt.show() diff --git a/doc/users/next_whats_new/widget_button_clear.rst b/doc/users/next_whats_new/widget_button_clear.rst deleted file mode 100644 index 2d16cf281e7c..000000000000 --- a/doc/users/next_whats_new/widget_button_clear.rst +++ /dev/null @@ -1,6 +0,0 @@ -Check and Radio Button widgets support clearing -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The `.CheckButtons` and `.RadioButtons` widgets now support clearing their -state by calling their ``.clear`` method. Note that it is not possible to have -no selected radio buttons, so the selected option at construction time is selected. diff --git a/doc/users/prev_whats_new/whats_new_3.9.0.rst b/doc/users/prev_whats_new/whats_new_3.9.0.rst new file mode 100644 index 000000000000..c111455f8ef8 --- /dev/null +++ b/doc/users/prev_whats_new/whats_new_3.9.0.rst @@ -0,0 +1,409 @@ +============================================= +What's new in Matplotlib 3.9.0 (Apr 09, 2024) +============================================= + +For a list of all of the issues and pull requests since the last revision, see the +:ref:`github-stats`. + +.. contents:: Table of Contents + :depth: 4 + +.. toctree:: + :maxdepth: 4 + +Plotting and Annotation improvements +==================================== + +``Axes.inset_axes`` is no longer experimental +--------------------------------------------- + +`.Axes.inset_axes` is considered stable for use. + +Legend support for Boxplot +-------------------------- + +Boxplots now support a *label* parameter to create legend entries. Legend labels can be +passed as a list of strings to label multiple boxes in a single `.Axes.boxplot` call: + +.. plot:: + :include-source: + :alt: Example of creating 3 boxplots and assigning legend labels as a sequence. + + np.random.seed(19680801) + fruit_weights = [ + np.random.normal(130, 10, size=100), + np.random.normal(125, 20, size=100), + np.random.normal(120, 30, size=100), + ] + labels = ['peaches', 'oranges', 'tomatoes'] + colors = ['peachpuff', 'orange', 'tomato'] + + fig, ax = plt.subplots() + ax.set_ylabel('fruit weight (g)') + + bplot = ax.boxplot(fruit_weights, + patch_artist=True, # fill with color + label=labels) + + # fill with colors + for patch, color in zip(bplot['boxes'], colors): + patch.set_facecolor(color) + + ax.set_xticks([]) + ax.legend() + + +Or as a single string to each individual `.Axes.boxplot`: + +.. plot:: + :include-source: + :alt: Example of creating 2 boxplots and assigning each legend label as a string. + + fig, ax = plt.subplots() + + data_A = np.random.random((100, 3)) + data_B = np.random.random((100, 3)) + 0.2 + pos = np.arange(3) + + ax.boxplot(data_A, positions=pos - 0.2, patch_artist=True, label='Box A', + boxprops={'facecolor': 'steelblue'}) + ax.boxplot(data_B, positions=pos + 0.2, patch_artist=True, label='Box B', + boxprops={'facecolor': 'lightblue'}) + + ax.legend() + +Percent sign in pie labels auto-escaped with ``usetex=True`` +------------------------------------------------------------ + +It is common, with `.Axes.pie`, to specify labels that include a percent sign (``%``), +which denotes a comment for LaTeX. When enabling LaTeX with :rc:`text.usetex` or passing +``textprops={"usetex": True}``, this used to cause the percent sign to disappear. + +Now, the percent sign is automatically escaped (by adding a preceding backslash) so that +it appears regardless of the ``usetex`` setting. If you have pre-escaped the percent +sign, this will be detected, and remain as is. + +``hatch`` parameter for stackplot +--------------------------------- + +The `~.Axes.stackplot` *hatch* parameter now accepts a list of strings describing +hatching styles that will be applied sequentially to the layers in the stack: + +.. plot:: + :include-source: + :alt: Two charts, identified as ax1 and ax2, showing "stackplots", i.e. one-dimensional distributions of data stacked on top of one another. The first plot, ax1 has cross-hatching on all slices, having been given a single string as the "hatch" argument. The second plot, ax2 has different styles of hatching on each slice - diagonal hatching in opposite directions on the first two slices, cross-hatching on the third slice, and open circles on the fourth. + + fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(10,5)) + + cols = 10 + rows = 4 + data = ( + np.reshape(np.arange(0, cols, 1), (1, -1)) ** 2 + + np.reshape(np.arange(0, rows), (-1, 1)) + + np.random.random((rows, cols))*5 + ) + x = range(data.shape[1]) + ax1.stackplot(x, data, hatch="x") + ax2.stackplot(x, data, hatch=["//","\\","x","o"]) + + ax1.set_title("hatch='x'") + ax2.set_title("hatch=['//','\\\\','x','o']") + + plt.show() + +Add option to plot only one half of violin plot +----------------------------------------------- + +Setting the parameter *side* to 'low' or 'high' allows to only plot one half of the +`.Axes.violinplot`. + +.. plot:: + :include-source: + :alt: Three copies of a vertical violin plot; first in blue showing the default of both sides, followed by an orange copy that only shows the "low" (or left, in this case) side, and finally a green copy that only shows the "high" (or right) side. + + # Fake data with reproducible random state. + np.random.seed(19680801) + data = np.random.normal(0, 8, size=100) + + fig, ax = plt.subplots() + + ax.violinplot(data, [0], showmeans=True, showextrema=True) + ax.violinplot(data, [1], showmeans=True, showextrema=True, side='low') + ax.violinplot(data, [2], showmeans=True, showextrema=True, side='high') + + ax.set_title('Violin Sides Example') + ax.set_xticks([0, 1, 2], ['Default', 'side="low"', 'side="high"']) + ax.set_yticklabels([]) + +``axhline`` and ``axhspan`` on polar axes +----------------------------------------- + +... now draw circles and circular arcs (`~.Axes.axhline`) or annuli and wedges +(`~.Axes.axhspan`). + +.. plot:: + :include-source: + :alt: A sample polar plot, that contains an axhline at radius 1, an axhspan annulus between radius 0.8 and 0.9, and an axhspan wedge between radius 0.6 and 0.7 and 288° and 324°. + + fig = plt.figure() + ax = fig.add_subplot(projection="polar") + ax.set_rlim(0, 1.2) + + ax.axhline(1, c="C0", alpha=.5) + ax.axhspan(.8, .9, fc="C1", alpha=.5) + ax.axhspan(.6, .7, .8, .9, fc="C2", alpha=.5) + +Subplot titles can now be automatically aligned +----------------------------------------------- + +Subplot axes titles can be misaligned vertically if tick labels or xlabels are placed at +the top of one subplot. The new `~.Figure.align_titles` method on the `.Figure` class +will now align the titles vertically. + +.. plot:: + :include-source: + :alt: A figure with two Axes side-by-side, the second of which with ticks on top. The Axes titles and x-labels appear unaligned with each other due to these ticks. + + fig, axs = plt.subplots(1, 2, layout='constrained') + + axs[0].plot(np.arange(0, 1e6, 1000)) + axs[0].set_title('Title 0') + axs[0].set_xlabel('XLabel 0') + + axs[1].plot(np.arange(1, 0, -0.1) * 2000, np.arange(1, 0, -0.1)) + axs[1].set_title('Title 1') + axs[1].set_xlabel('XLabel 1') + axs[1].xaxis.tick_top() + axs[1].tick_params(axis='x', rotation=55) + +.. plot:: + :include-source: + :alt: A figure with two Axes side-by-side, the second of which with ticks on top. Unlike the previous figure, the Axes titles and x-labels appear aligned. + + fig, axs = plt.subplots(1, 2, layout='constrained') + + axs[0].plot(np.arange(0, 1e6, 1000)) + axs[0].set_title('Title 0') + axs[0].set_xlabel('XLabel 0') + + axs[1].plot(np.arange(1, 0, -0.1) * 2000, np.arange(1, 0, -0.1)) + axs[1].set_title('Title 1') + axs[1].set_xlabel('XLabel 1') + axs[1].xaxis.tick_top() + axs[1].tick_params(axis='x', rotation=55) + + fig.align_labels() + fig.align_titles() + +``axisartist`` can now be used together with standard ``Formatters`` +-------------------------------------------------------------------- + +... instead of being limited to axisartist-specific ones. + +Toggle minorticks on Axis +------------------------- + +Minor ticks on an `~matplotlib.axis.Axis` can be displayed or removed using +`~matplotlib.axis.Axis.minorticks_on` and `~matplotlib.axis.Axis.minorticks_off`; e.g., +``ax.xaxis.minorticks_on()``. See also `~matplotlib.axes.Axes.minorticks_on`. + +``StrMethodFormatter`` now respects ``axes.unicode_minus`` +---------------------------------------------------------- + +When formatting negative values, `.StrMethodFormatter` will now use unicode minus signs +if :rc:`axes.unicode_minus` is set. + + >>> from matplotlib.ticker import StrMethodFormatter + >>> with plt.rc_context({'axes.unicode_minus': False}): + ... formatter = StrMethodFormatter('{x}') + ... print(formatter.format_data(-10)) + -10 + + >>> with plt.rc_context({'axes.unicode_minus': True}): + ... formatter = StrMethodFormatter('{x}') + ... print(formatter.format_data(-10)) + −10 + +Figure, Axes, and Legend Layout +=============================== + +Subfigures now have controllable zorders +---------------------------------------- + +Previously, setting the zorder of a subfigure had no effect, and those were plotted on +top of any figure-level artists (i.e for example on top of fig-level legends). Now, +subfigures behave like any other artists, and their zorder can be controlled, with +default a zorder of 0. + +.. plot:: + :include-source: + :alt: Example on controlling the zorder of a subfigure + + x = np.linspace(1, 10, 10) + y1, y2 = x, -x + fig = plt.figure(constrained_layout=True) + subfigs = fig.subfigures(nrows=1, ncols=2) + for subfig in subfigs: + axarr = subfig.subplots(2, 1) + for ax in axarr.flatten(): + (l1,) = ax.plot(x, y1, label="line1") + (l2,) = ax.plot(x, y2, label="line2") + subfigs[0].set_zorder(6) + l = fig.legend(handles=[l1, l2], loc="upper center", ncol=2) + +Getters for xmargin, ymargin and zmargin +---------------------------------------- + +`.Axes.get_xmargin`, `.Axes.get_ymargin` and `.Axes3D.get_zmargin` methods have been +added to return the margin values set by `.Axes.set_xmargin`, `.Axes.set_ymargin` and +`.Axes3D.set_zmargin`, respectively. + +Mathtext improvements +===================== + +``mathtext`` documentation improvements +--------------------------------------- + +The documentation is updated to take information directly from the parser. This means +that (almost) all supported symbols, operators, etc. are shown at :ref:`mathtext`. + +``mathtext`` spacing corrections +-------------------------------- + +As consequence of the updated documentation, the spacing on a number of relational and +operator symbols were correctly classified and therefore will be spaced properly. + +Widget Improvements +=================== + +Check and Radio Button widgets support clearing +----------------------------------------------- + +The `.CheckButtons` and `.RadioButtons` widgets now support clearing their state by +calling their ``.clear`` method. Note that it is not possible to have no selected radio +buttons, so the selected option at construction time is selected. + +3D plotting improvements +======================== + +Setting 3D axis limits now set the limits exactly +------------------------------------------------- + +Previously, setting the limits of a 3D axis would always add a small margin to the +limits. Limits are now set exactly by default. The newly introduced rcparam +``axes3d.automargin`` can be used to revert to the old behavior where margin is +automatically added. + +.. plot:: + :include-source: + :alt: Example of the new behavior of 3D axis limits, and how setting the rcParam reverts to the old behavior. + + fig, axs = plt.subplots(1, 2, subplot_kw={'projection': '3d'}) + + plt.rcParams['axes3d.automargin'] = True + axs[0].set(xlim=(0, 1), ylim=(0, 1), zlim=(0, 1), title='Old Behavior') + + plt.rcParams['axes3d.automargin'] = False # the default in 3.9.0 + axs[1].set(xlim=(0, 1), ylim=(0, 1), zlim=(0, 1), title='New Behavior') + +Other improvements +================== + +BackendRegistry +--------------- + +New :class:`~matplotlib.backends.registry.BackendRegistry` class is the single source of +truth for available backends. The singleton instance is +``matplotlib.backends.backend_registry``. It is used internally by Matplotlib, and also +IPython (and therefore Jupyter) starting with IPython 8.24.0. + +There are three sources of backends: built-in (source code is within the Matplotlib +repository), explicit ``module://some.backend`` syntax (backend is obtained by loading +the module), or via an entry point (self-registering backend in an external package). + +To obtain a list of all registered backends use: + + >>> from matplotlib.backends import backend_registry + >>> backend_registry.list_all() + +Add ``widths``, ``heights`` and ``angles`` setter to ``EllipseCollection`` +-------------------------------------------------------------------------- + +The ``widths``, ``heights`` and ``angles`` values of the +`~matplotlib.collections.EllipseCollection` can now be changed after the collection has +been created. + +.. plot:: + :include-source: + + from matplotlib.collections import EllipseCollection + + rng = np.random.default_rng(0) + + widths = (2, ) + heights = (3, ) + angles = (45, ) + offsets = rng.random((10, 2)) * 10 + + fig, ax = plt.subplots() + + ec = EllipseCollection( + widths=widths, + heights=heights, + angles=angles, + offsets=offsets, + units='x', + offset_transform=ax.transData, + ) + + ax.add_collection(ec) + ax.set_xlim(-2, 12) + ax.set_ylim(-2, 12) + + new_widths = rng.random((10, 2)) * 2 + new_heights = rng.random((10, 2)) * 3 + new_angles = rng.random((10, 2)) * 180 + + ec.set(widths=new_widths, heights=new_heights, angles=new_angles) + +``image.interpolation_stage`` rcParam +------------------------------------- + +This new rcParam controls whether image interpolation occurs in "data" space or in +"rgba" space. + +Arrow patch position is now modifiable +-------------------------------------- + +A setter method has been added that allows updating the position of the `.patches.Arrow` +object without requiring a full re-draw. + +.. plot:: + :include-source: + :alt: Example of changing the position of the arrow with the new ``set_data`` method. + + from matplotlib import animation + from matplotlib.patches import Arrow + + fig, ax = plt.subplots() + ax.set_xlim(0, 10) + ax.set_ylim(0, 10) + + a = Arrow(2, 0, 0, 10) + ax.add_patch(a) + + + # code for modifying the arrow + def update(i): + a.set_data(x=.5, dx=i, dy=6, width=2) + + + ani = animation.FuncAnimation(fig, update, frames=15, interval=90, blit=False) + + plt.show() + +NonUniformImage now has mouseover support +----------------------------------------- + +When mousing over a `~matplotlib.image.NonUniformImage`, the data values are now +displayed. diff --git a/doc/users/release_notes.rst b/doc/users/release_notes.rst index 63f417e6a26d..3befbeee5b77 100644 --- a/doc/users/release_notes.rst +++ b/doc/users/release_notes.rst @@ -18,8 +18,8 @@ Version 3.9 .. toctree:: :maxdepth: 1 - next_whats_new - ../api/next_api_changes + prev_whats_new/whats_new_3.9.0.rst + ../api/prev_api_changes/api_changes_3.9.0.rst github_stats.rst Version 3.8 @@ -30,7 +30,6 @@ Version 3.8 prev_whats_new/whats_new_3.8.0.rst ../api/prev_api_changes/api_changes_3.8.1.rst ../api/prev_api_changes/api_changes_3.8.0.rst - github_stats.rst prev_whats_new/github_stats_3.8.3.rst prev_whats_new/github_stats_3.8.2.rst prev_whats_new/github_stats_3.8.1.rst