diff --git a/doc/_static/image.svg b/doc/_static/image.svg new file mode 100644 index 000000000000..c101e6aea399 --- /dev/null +++ b/doc/_static/image.svg @@ -0,0 +1,381 @@ + + + + + + + + 2026-04-26T10:16:40.198456 + image/svg+xml + + + Matplotlib v3.11.0.dev2285+ge1329a5eb.d20260419, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/_static/scatter.svg b/doc/_static/scatter.svg new file mode 100644 index 000000000000..6db3c159c093 --- /dev/null +++ b/doc/_static/scatter.svg @@ -0,0 +1,591 @@ + + + + + + + + 2026-04-26T10:16:39.958872 + image/svg+xml + + + Matplotlib v3.11.0.dev2285+ge1329a5eb.d20260419, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/api/next_api_changes/behavior/28437-CH.rst b/doc/api/next_api_changes/behavior/28437-CH.rst deleted file mode 100644 index 9d0161b6aac9..000000000000 --- a/doc/api/next_api_changes/behavior/28437-CH.rst +++ /dev/null @@ -1,11 +0,0 @@ -*alpha* parameter handling on images -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Prior to Matplotlib 3.10.1, when passing an array to ``imshow(..., alpha=...)``, the -parameter was silently ignored if the image data was an RGB or RGBA image or if -:rc:`image.interpolation_stage` resolved to "rbga". - -Matplotlib 3.10.1 changed this to apply the alpha array as the alpha channel, -overwriting any existing transparency information in the image data. Matplotlib v3.11.0 -further fixes the handling for RGBA images: the existing alpha channel is now multiplied -by the alpha array, consistent with how scalar alpha values are handled. diff --git a/doc/api/next_api_changes/behavior/29054-AL.rst b/doc/api/next_api_changes/behavior/29054-AL.rst deleted file mode 100644 index 3c65e9ae9b78..000000000000 --- a/doc/api/next_api_changes/behavior/29054-AL.rst +++ /dev/null @@ -1,11 +0,0 @@ -Minor log tick labels are set depending on number of major log ticks, not on number of decades spanned -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Previously, by default, on a log-scaled axis, the minor ticks would be -unlabeled if the axis limits spanned more than one decade. The meaning of the -``minor_thresholds`` parameter to `.LogFormatter` has been altered so that the -decision of whether to label the minor ticks is now based on the number of -major ticks drawn within the axis limits. - -For example, for an axis spanning from 4 to 60 (with thus a single major log -tick, at 10), minor ticks are now labeled, even though the axis spans more than -one decade. diff --git a/doc/api/next_api_changes/behavior/29256_IMT.rst b/doc/api/next_api_changes/behavior/29256_IMT.rst deleted file mode 100644 index 57ec8f68d85c..000000000000 --- a/doc/api/next_api_changes/behavior/29256_IMT.rst +++ /dev/null @@ -1,6 +0,0 @@ -Setting titles of figures using webagg backend -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Previously when using the ``webagg`` backend the title of a figure was set using -``figure.set_label``. Now it is set using ``figure.canvas.manager.set_window_title`` -which is more consistent with other backends. diff --git a/doc/api/next_api_changes/behavior/29827-ES.rst b/doc/api/next_api_changes/behavior/29827-ES.rst deleted file mode 100644 index d25dfa0c6574..000000000000 --- a/doc/api/next_api_changes/behavior/29827-ES.rst +++ /dev/null @@ -1,6 +0,0 @@ -``matplotlib.testing.check_figures_equal`` defaults to PNG only -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In most cases, checking that figures are equal with `.check_figures_equal` does not -depend on the file format. Consequently, the *extensions* parameter now defaults to -``['png']`` instead of ``['png', 'pdf', 'svg']``, reducing default test requirements. diff --git a/doc/api/next_api_changes/behavior/29832-REC.rst b/doc/api/next_api_changes/behavior/29832-REC.rst deleted file mode 100644 index a23b043a823b..000000000000 --- a/doc/api/next_api_changes/behavior/29832-REC.rst +++ /dev/null @@ -1,11 +0,0 @@ -Mixing positional and keyword arguments for ``legend`` handles and labels... -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... is no longer valid. If passing *handles* and *labels* to ``legend``, they must -now be passed either both positionally or both as keywords. - -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 length is not one an error is raised. To keep the old -behavior, cast the sequence to string before passing. diff --git a/doc/api/next_api_changes/behavior/29958-TH.rst b/doc/api/next_api_changes/behavior/29958-TH.rst deleted file mode 100644 index cacaf2bac612..000000000000 --- a/doc/api/next_api_changes/behavior/29958-TH.rst +++ /dev/null @@ -1,8 +0,0 @@ -``Axes.add_collection(..., autolim=True)`` updates view limits -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``Axes.add_collection(..., autolim=True)`` has so far only updated the data limits. -Users needed to additionally call `.Axes.autoscale_view` to update the view limits. -View limits are now updated as well if ``autolim=True``, using a lazy internal -update mechanism, so that the costs only apply once also if you add multiple -collections. diff --git a/doc/api/next_api_changes/behavior/30108-REC.rst b/doc/api/next_api_changes/behavior/30108-REC.rst deleted file mode 100644 index ce4fb0833207..000000000000 --- a/doc/api/next_api_changes/behavior/30108-REC.rst +++ /dev/null @@ -1,6 +0,0 @@ -Complex layouts and constrained layout -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Constrained layout now produces smaller spacing between subplots in some -circumstances. This should only affect complex layouts where rows or columns -contain different numbers of subplots, for example a layout created with -``plt.subplot_mosaic('AC;BC', layout='constrained')``. diff --git a/doc/api/next_api_changes/behavior/30272-ES.rst b/doc/api/next_api_changes/behavior/30272-ES.rst deleted file mode 100644 index 5a03f9bc7972..000000000000 --- a/doc/api/next_api_changes/behavior/30272-ES.rst +++ /dev/null @@ -1,2 +0,0 @@ -``font_manager.findfont`` logs if selected font weight does not match requested -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/api/next_api_changes/behavior/30318-ES.rst b/doc/api/next_api_changes/behavior/30318-ES.rst deleted file mode 100644 index 805901dcb21d..000000000000 --- a/doc/api/next_api_changes/behavior/30318-ES.rst +++ /dev/null @@ -1,9 +0,0 @@ -FT2Font no longer sets a default size -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In the interest of handling non-scalable fonts and reducing font initialization, the -`.FT2Font` constructor no longer sets a default size. Non-scalable fonts are sometimes -used for bitmap-backed emoji fonts. - -If metrics are important (i.e., if you are loading character glyphs, or setting a text -string), then explicitly call `.FT2Font.set_size` beforehand. diff --git a/doc/api/next_api_changes/behavior/30335-ES.rst b/doc/api/next_api_changes/behavior/30335-ES.rst deleted file mode 100644 index 26b059401e19..000000000000 --- a/doc/api/next_api_changes/behavior/30335-ES.rst +++ /dev/null @@ -1,15 +0,0 @@ -``mathtext.VectorParse`` now includes glyph indices -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -For a *path*-outputting `.MathTextParser`, in the return value of -`~.MathTextParser.parse`, (a `.VectorParse`), the *glyphs* field is now a list -containing tuples of: - -- font: `.FT2Font` -- fontsize: `float` -- character code: `int` -- glyph index: `int` -- x: `float` -- y: `float` - -Specifically, the glyph index was added after the character code. diff --git a/doc/api/next_api_changes/behavior/30532-TH.rst b/doc/api/next_api_changes/behavior/30532-TH.rst deleted file mode 100644 index 3d368c566039..000000000000 --- a/doc/api/next_api_changes/behavior/30532-TH.rst +++ /dev/null @@ -1,4 +0,0 @@ -Default name of ``ListedColormap`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The default name of `.ListedColormap` has changed from "from_list" to "unnamed". diff --git a/doc/api/next_api_changes/behavior/30634-AL.rst b/doc/api/next_api_changes/behavior/30634-AL.rst deleted file mode 100644 index 585de1ea14eb..000000000000 --- a/doc/api/next_api_changes/behavior/30634-AL.rst +++ /dev/null @@ -1,6 +0,0 @@ -hist2d no longer forces axes limits -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Previously, `.Axes.hist2d` would force the axes x and y limits to the extents -of the histogrammed data, ignoring any other artists. `.Axes.hist2d` now -behaves similarly to `.Axes.imshow`: axes limits are updated to fit the data, -but autoscaling is not otherwise disabled. diff --git a/doc/api/next_api_changes/behavior/30824-AYS.rst b/doc/api/next_api_changes/behavior/30824-AYS.rst deleted file mode 100644 index a190bd537126..000000000000 --- a/doc/api/next_api_changes/behavior/30824-AYS.rst +++ /dev/null @@ -1,6 +0,0 @@ -Bivariate colormaps now fully span the intended range of colors -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Bivariate colormaps generated by ``SegmentedBivarColormap`` (e.g., ``BiOrangeBlue``) -from a set of input colors now fully span that range of colors. There had been a bug -with the numerical interpolation such that the colormap did not actually include the -first or last colors. diff --git a/doc/api/next_api_changes/behavior/30975-VM.rst b/doc/api/next_api_changes/behavior/30975-VM.rst deleted file mode 100644 index 185b57ac5de6..000000000000 --- a/doc/api/next_api_changes/behavior/30975-VM.rst +++ /dev/null @@ -1,9 +0,0 @@ -Windows configuration directory location -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -On Windows, the default configuration and cache directories now use -``%LOCALAPPDATA%\matplotlib`` instead of ``%USERPROFILE%\.matplotlib``. -This follows Windows application data storage conventions. - -The ``MPLCONFIGDIR`` environment variable can still be used to override -this default. diff --git a/doc/api/next_api_changes/behavior/31021-AYS.rst b/doc/api/next_api_changes/behavior/31021-AYS.rst deleted file mode 100644 index aa5dc598cb26..000000000000 --- a/doc/api/next_api_changes/behavior/31021-AYS.rst +++ /dev/null @@ -1,7 +0,0 @@ -Rendering of images now more accurate -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -There have been several fixes to improve the accuracy of how images are -resampled and placed during rendering. Some inaccuracies were up to a pixel off -in the output. The most apparent improvement is that the alignment of data -pixels with tick marks and grid lines is now reliable. Nearly all image output -has changed, but often only at a subtle level that is not obvious qualitatively. diff --git a/doc/api/next_api_changes/behavior/31148-ES.rst b/doc/api/next_api_changes/behavior/31148-ES.rst deleted file mode 100644 index 08ad9b7cb0c1..000000000000 --- a/doc/api/next_api_changes/behavior/31148-ES.rst +++ /dev/null @@ -1,6 +0,0 @@ -Default *style* parameter of ``image_comparison`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The *style* parameter of the `.image_comparison` decorator will become 'mpl20' in -Matplotlib 3.13. Not passing it and relying on the previous default will warn until the -change occurs. diff --git a/doc/api/next_api_changes/behavior/31223-AS.rst b/doc/api/next_api_changes/behavior/31223-AS.rst deleted file mode 100644 index 0880659e55ee..000000000000 --- a/doc/api/next_api_changes/behavior/31223-AS.rst +++ /dev/null @@ -1,28 +0,0 @@ -``pyplot.subplot`` and ``pyplot.subplot_mosaic`` raise *ValueError* on existing figures ----------------------------------------------------------------------------------------- - -Passing a *num* argument to `~.pyplot.subplots` or `~.pyplot.subplot_mosaic` -that refers to an existing figure or is a ``Figure`` instance now raises a -`ValueError`. - -These utility functions are intended strictly for the creation of new figures and -subplots. Previously, they accidentally allowed the reuse of existing figures because -they internally called `~.pyplot.figure`. This change ensures that these functions -strictly follow their documented purpose of creating new figures. - -To reuse an existing figure, clear it first using ``clear=True``: - -.. code-block:: python - - fig, axs = plt.subplots(num=1, clear=True) - # or - fig, axd = plt.subplot_mosaic([['A', 'B']], num=1, clear=True) - -If you have a ``Figure`` instance and want to add subplots to it, use the -object-oriented API: - -.. code-block:: python - - fig.subplots(nrows=2, ncols=2) - # or - fig.subplot_mosaic([['A', 'B']]) diff --git a/doc/api/next_api_changes/behavior/31486-ES.rst b/doc/api/next_api_changes/behavior/31486-ES.rst deleted file mode 100644 index a04c1d025d90..000000000000 --- a/doc/api/next_api_changes/behavior/31486-ES.rst +++ /dev/null @@ -1,6 +0,0 @@ -New environment variable to ignore system fonts -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -System fonts may be ignored by setting the :envvar:`MPL_IGNORE_SYSTEM_FONTS`; this -suppresses searching for system fonts (in known directories or via some -platform-specific subprocess) as well as limiting the results from `.FontManager.findfont`. diff --git a/doc/api/next_api_changes/behavior/31530-TZ.rst b/doc/api/next_api_changes/behavior/31530-TZ.rst deleted file mode 100644 index 470104817a59..000000000000 --- a/doc/api/next_api_changes/behavior/31530-TZ.rst +++ /dev/null @@ -1,6 +0,0 @@ -``relim()`` now accounts for Collection artists -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Previously, `~.axes.Axes.relim` did not recalculate data limits for -`.Collection` artists (e.g. those created by `~.axes.Axes.scatter`). -Calling ``ax.relim()`` followed by ``ax.autoscale_view()`` now correctly -includes scatter plots and other collections in the axes limits. diff --git a/doc/api/next_api_changes/behavior/31578-TH.rst b/doc/api/next_api_changes/behavior/31578-TH.rst deleted file mode 100644 index 0607652c7c8f..000000000000 --- a/doc/api/next_api_changes/behavior/31578-TH.rst +++ /dev/null @@ -1,10 +0,0 @@ -SVG links open in new tab or window -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -`.Artist.set_url` allows to turn the Artist into a link. In SVG output, -this has been implemented without specifying a `target`_ attribute. The default -target value "_self" resulted in replacing the SVG document with the linked page -when the link was clicked. - -The target is now set to "_blank" so that the link opens in a new tab or window. - -.. _target: https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/target diff --git a/doc/api/next_api_changes/deprecations/27551-AL.rst b/doc/api/next_api_changes/deprecations/27551-AL.rst deleted file mode 100644 index 4811f542bd5f..000000000000 --- a/doc/api/next_api_changes/deprecations/27551-AL.rst +++ /dev/null @@ -1,4 +0,0 @@ -``GridFinder.transform_xy`` and ``GridFinder.inv_transform_xy`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... are deprecated. Directly use the standard transform returned by -`.GridFinder.get_transform` instead. diff --git a/doc/api/next_api_changes/deprecations/27972-AL.rst b/doc/api/next_api_changes/deprecations/27972-AL.rst deleted file mode 100644 index cf14b24345b5..000000000000 --- a/doc/api/next_api_changes/deprecations/27972-AL.rst +++ /dev/null @@ -1,8 +0,0 @@ -``axes_grid.Grid.ngrids`` -~~~~~~~~~~~~~~~~~~~~~~~~~ -This attribute has been deprecated and renamed ``n_axes``, consistently with -the new name of the `~.axes_grid.Grid` constructor parameter that allows -setting the actual number of axes in the grid (the old parameter, ``ngrids``, -did not actually work since Matplotlib 3.3). - -The same change has been made in ``axes_grid.ImageGrid``. diff --git a/doc/api/next_api_changes/deprecations/27998-TS.rst b/doc/api/next_api_changes/deprecations/27998-TS.rst deleted file mode 100644 index ab69b87f0989..000000000000 --- a/doc/api/next_api_changes/deprecations/27998-TS.rst +++ /dev/null @@ -1,7 +0,0 @@ -``violinplot`` and ``violin`` *vert* parameter -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The parameter *vert: bool* has been deprecated on `~.Axes.violinplot` and -`~.Axes.violin`. -It will be replaced by *orientation: {"vertical", "horizontal"}* for API -consistency. diff --git a/doc/api/next_api_changes/deprecations/28074-TS.rst b/doc/api/next_api_changes/deprecations/28074-TS.rst deleted file mode 100644 index 6a8b5d4b21b8..000000000000 --- a/doc/api/next_api_changes/deprecations/28074-TS.rst +++ /dev/null @@ -1,9 +0,0 @@ -``boxplot`` and ``bxp`` *vert* parameter, and ``rcParams["boxplot.vertical"]`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The parameter *vert: bool* has been deprecated on `~.Axes.boxplot` and -`~.Axes.bxp`. It is replaced by *orientation: {"vertical", "horizontal"}* -for API consistency. - -``rcParams["boxplot.vertical"]``, which controlled the orientation of ``boxplot``, -is deprecated without replacement. diff --git a/doc/api/next_api_changes/deprecations/29135-TH.rst b/doc/api/next_api_changes/deprecations/29135-TH.rst deleted file mode 100644 index e2289a248076..000000000000 --- a/doc/api/next_api_changes/deprecations/29135-TH.rst +++ /dev/null @@ -1,5 +0,0 @@ -Parameter ``ListedColormap(..., N=...)`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Passing the parameter *N* to `.ListedColormap` is deprecated. -Please preprocess the list colors yourself if needed. diff --git a/doc/api/next_api_changes/deprecations/29358-TH.rst b/doc/api/next_api_changes/deprecations/29358-TH.rst deleted file mode 100644 index 1b7a50456afc..000000000000 --- a/doc/api/next_api_changes/deprecations/29358-TH.rst +++ /dev/null @@ -1,17 +0,0 @@ -3rd party scales do not need to have an *axis* parameter anymore -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Since matplotlib 3.1 `PR 12831 `_ -scale objects should be reusable and therefore independent of any particular Axis. -Therefore, the use of the *axis* parameter in the ``__init__`` had been discouraged. -However, having that parameter in the signature was still necessary for API -backwards-compatibility. This is no longer the case. - -`.register_scale` now accepts scale classes with or without this parameter. - -The *axis* parameter is pending-deprecated. It will be deprecated in matplotlib 3.13, -and removed in matplotlib 3.15. - -3rd-party scales are recommended to remove the *axis* parameter now if they can -afford to restrict compatibility to matplotlib >= 3.11 already. Otherwise, they may -keep the *axis* parameter and remove it in time for matplotlib 3.13. diff --git a/doc/api/next_api_changes/deprecations/29529-TH.rst b/doc/api/next_api_changes/deprecations/29529-TH.rst deleted file mode 100644 index e396e68c4aa1..000000000000 --- a/doc/api/next_api_changes/deprecations/29529-TH.rst +++ /dev/null @@ -1,7 +0,0 @@ -Capitalization of None in matplotlibrc -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In :file:`matplotlibrc` config files every capitalization of None was -accepted for denoting the Python constant `None`. This is deprecated. The -only accepted capitalization is now None, i.e. starting with a capital letter -and all other letters in lowercase. diff --git a/doc/api/next_api_changes/deprecations/29817-AL.rst b/doc/api/next_api_changes/deprecations/29817-AL.rst deleted file mode 100644 index f3b339ed7c10..000000000000 --- a/doc/api/next_api_changes/deprecations/29817-AL.rst +++ /dev/null @@ -1,7 +0,0 @@ -``DviFont.widths`` -~~~~~~~~~~~~~~~~~~ -... is deprecated with no replacement. - -Direct access to ``Tfm``'s ``widths``, ``heights``, ``depths`` dicts -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... is deprecated; access a glyph's metrics with `.Tfm.get_metrics` instead. diff --git a/doc/api/next_api_changes/deprecations/29904-tac.rst b/doc/api/next_api_changes/deprecations/29904-tac.rst deleted file mode 100644 index 8e4f986ffa77..000000000000 --- a/doc/api/next_api_changes/deprecations/29904-tac.rst +++ /dev/null @@ -1,16 +0,0 @@ - -Increase to minimum supported versions of dependencies -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -For Matplotlib 3.11, the :ref:`minimum supported versions ` are -being bumped: - -+------------+-----------------+----------------+ -| Dependency | min in mpl3.10 | min in mpl3.11 | -+============+=================+================+ -| Python | 3.10 | 3.11 | -| NumPy | 1.23 | 1.25 | -+------------+-----------------+----------------+ - -This is consistent with our :ref:`min_deps_policy` and `SPEC0 -`__ diff --git a/doc/api/next_api_changes/deprecations/29993-AL.rst b/doc/api/next_api_changes/deprecations/29993-AL.rst deleted file mode 100644 index 9104fd669325..000000000000 --- a/doc/api/next_api_changes/deprecations/29993-AL.rst +++ /dev/null @@ -1,4 +0,0 @@ -``testing.widgets.mock_event`` and ``testing.widgets.do_event`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... are deprecated. Directly construct Event objects (typically `.MouseEvent` -or `.KeyEvent`) and pass them to ``canvas.callbacks.process()`` instead. diff --git a/doc/api/next_api_changes/deprecations/30027-AL.rst b/doc/api/next_api_changes/deprecations/30027-AL.rst deleted file mode 100644 index ed65d9391371..000000000000 --- a/doc/api/next_api_changes/deprecations/30027-AL.rst +++ /dev/null @@ -1,3 +0,0 @@ -``PdfFile.fontNames``, ``PdfFile.dviFontInfo``, ``PdfFile.type1Descriptors`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... are deprecated with no replacement. diff --git a/doc/api/next_api_changes/deprecations/30044-AL.rst b/doc/api/next_api_changes/deprecations/30044-AL.rst deleted file mode 100644 index e004d5f2730f..000000000000 --- a/doc/api/next_api_changes/deprecations/30044-AL.rst +++ /dev/null @@ -1,12 +0,0 @@ -``FT2Image`` -~~~~~~~~~~~~ -... is deprecated. Use 2D uint8 ndarrays instead. In particular: - -- The ``FT2Image`` constructor took ``width, height`` as separate parameters - but the ndarray constructor takes ``(height, width)`` as single tuple - parameter. -- `.FT2Font.draw_glyph_to_bitmap` now (also) takes 2D uint8 arrays as input. -- ``FT2Image.draw_rect_filled`` should be replaced by directly setting pixel - values to black. -- The ``image`` attribute of the object returned by ``MathTextParser("agg").parse`` - is now a 2D uint8 array. diff --git a/doc/api/next_api_changes/deprecations/30070-OG.rst b/doc/api/next_api_changes/deprecations/30070-OG.rst deleted file mode 100644 index 98786bcfa1d2..000000000000 --- a/doc/api/next_api_changes/deprecations/30070-OG.rst +++ /dev/null @@ -1,4 +0,0 @@ -``BezierSegment.point_at_t`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -... is deprecated. Instead, it is possible to call the BezierSegment with an argument. diff --git a/doc/api/next_api_changes/deprecations/30088-AL.rst b/doc/api/next_api_changes/deprecations/30088-AL.rst deleted file mode 100644 index ae1338da7f85..000000000000 --- a/doc/api/next_api_changes/deprecations/30088-AL.rst +++ /dev/null @@ -1,4 +0,0 @@ -*fontfile* parameter of ``PdfFile.createType1Descriptor`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This parameter is deprecated; all relevant pieces of information are now -directly extracted from the *t1font* argument. diff --git a/doc/api/next_api_changes/deprecations/30163-AL.rst b/doc/api/next_api_changes/deprecations/30163-AL.rst deleted file mode 100644 index 15d0077375f2..000000000000 --- a/doc/api/next_api_changes/deprecations/30163-AL.rst +++ /dev/null @@ -1,9 +0,0 @@ -``matplotlib.style.core`` -~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``matplotlib.style.core`` module is deprecated. All APIs intended for -public use are now available in `matplotlib.style` directly (including -``USER_LIBRARY_PATHS``, which was previously not reexported). - -The following APIs of ``matplotlib.style.core`` have been deprecated with no -replacement: ``BASE_LIBRARY_PATH``, ``STYLE_EXTENSION``, ``STYLE_BLACKLIST``, -``update_user_library``, ``read_style_directory``, ``update_nested_dict``. diff --git a/doc/api/next_api_changes/deprecations/30322-ES.rst b/doc/api/next_api_changes/deprecations/30322-ES.rst deleted file mode 100644 index b9c4964e58c8..000000000000 --- a/doc/api/next_api_changes/deprecations/30322-ES.rst +++ /dev/null @@ -1,7 +0,0 @@ -Font kerning factor is deprecated -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Due to internal changes to support complex text rendering, the kerning factor on fonts is -no longer used. Setting the ``text.kerning_factor`` rcParam (which existed only for -backwards-compatibility) to any value other than None is deprecated, and the rcParam will -be removed in the future. diff --git a/doc/api/next_api_changes/deprecations/30329-ES.rst b/doc/api/next_api_changes/deprecations/30329-ES.rst deleted file mode 100644 index 8d5060c4821b..000000000000 --- a/doc/api/next_api_changes/deprecations/30329-ES.rst +++ /dev/null @@ -1,4 +0,0 @@ -``font_manager.is_opentype_cff_font`` is deprecated -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -There is no replacement. diff --git a/doc/api/next_api_changes/deprecations/30349-AL.rst b/doc/api/next_api_changes/deprecations/30349-AL.rst deleted file mode 100644 index 78e26f41889f..000000000000 --- a/doc/api/next_api_changes/deprecations/30349-AL.rst +++ /dev/null @@ -1,3 +0,0 @@ -``Axes.set_navigate_mode`` is deprecated -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... with no replacement. diff --git a/doc/api/next_api_changes/deprecations/30364-AS.rst b/doc/api/next_api_changes/deprecations/30364-AS.rst deleted file mode 100644 index 4f5493b8b706..000000000000 --- a/doc/api/next_api_changes/deprecations/30364-AS.rst +++ /dev/null @@ -1,4 +0,0 @@ -Parameters ``Axes3D.set_aspect(..., anchor=..., share=...)`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The parameters *anchor* and *share* of `.Axes3D.set_aspect` are deprecated. -They had no effect on 3D axes and will be removed in a future version. diff --git a/doc/api/next_api_changes/deprecations/30368-AL.rst b/doc/api/next_api_changes/deprecations/30368-AL.rst deleted file mode 100644 index efd3c8360ef3..000000000000 --- a/doc/api/next_api_changes/deprecations/30368-AL.rst +++ /dev/null @@ -1,3 +0,0 @@ -``GridFinder.get_grid_info`` now takes a single bbox as parameter -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Passing ``x1, y1, x2, y2`` as separate parameters is deprecated. diff --git a/doc/api/next_api_changes/deprecations/30369-AL.rst b/doc/api/next_api_changes/deprecations/30369-AL.rst deleted file mode 100644 index 8b82c80054d9..000000000000 --- a/doc/api/next_api_changes/deprecations/30369-AL.rst +++ /dev/null @@ -1,14 +0,0 @@ -:mod:`.axisartist` now uses more standard tick direction controls -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Previously, the position of :mod:`.axisartist` ticks (inside or outside -the axes) were set using ``set_tick_out(bool)``. They are now set -using ``set_tick_direction("in")`` (or "out", or "inout"), and respect -:rc:`xtick.direction` and :rc:`ytick.direction`. In particular, they default -to pointing outwards, consistently with the rest of the library. - -The *tick_out* parameter of `.Ticks` has been deprecated (use *tick_direction* -instead). The ``Ticks.get_tick_out`` method is deprecated (use -`.Ticks.get_tick_direction` instead). - -The unused ``locs_angles_labels`` attribute of `.Ticks` and `.LabelBase` has -also been deprecated. diff --git a/doc/api/next_api_changes/deprecations/30469-AL.rst b/doc/api/next_api_changes/deprecations/30469-AL.rst deleted file mode 100644 index ef3f042843c2..000000000000 --- a/doc/api/next_api_changes/deprecations/30469-AL.rst +++ /dev/null @@ -1,4 +0,0 @@ -The *axes* parameter of ``RadialLocator`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... is deprecated. `~.polar.RadialLocator` now fetches the relevant information -from the Axis' parent Axes. diff --git a/doc/api/next_api_changes/deprecations/30512-ES.rst b/doc/api/next_api_changes/deprecations/30512-ES.rst deleted file mode 100644 index f235964c5502..000000000000 --- a/doc/api/next_api_changes/deprecations/30512-ES.rst +++ /dev/null @@ -1,3 +0,0 @@ -``PdfFile.multi_byte_charprocs`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -... is deprecated with no replacement. diff --git a/doc/api/next_api_changes/deprecations/30531-TH.rst b/doc/api/next_api_changes/deprecations/30531-TH.rst deleted file mode 100644 index 19d51fd2fb6c..000000000000 --- a/doc/api/next_api_changes/deprecations/30531-TH.rst +++ /dev/null @@ -1,16 +0,0 @@ -In-place modifications of colormaps -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Colormaps are planned to become immutable in the long term. - -As a first step, in-place modifications of colormaps are now pending-deprecated. -This affects the following methods of `.Colormap`: - -- `.Colormap.set_bad` - use ``cmap.with_extremes(bad=...)`` instead -- `.Colormap.set_under` - use ``cmap.with_extremes(under=...)`` instead -- `.Colormap.set_over` - use ``cmap.with_extremes(over=...)`` instead -- `.Colormap.set_extremes` - use ``cmap.with_extremes(...)`` instead - -Use the respective `.Colormap.with_extremes` and appropriate keyword arguments -instead which returns a copy of the colormap (available since matplotlib 3.4). -Alternatively, if you create the colormap yourself, you can also pass the -respective arguments to the constructor (available since matplotlib 3.11). diff --git a/doc/api/next_api_changes/deprecations/30737-TH.rst b/doc/api/next_api_changes/deprecations/30737-TH.rst deleted file mode 100644 index 8feef85912b4..000000000000 --- a/doc/api/next_api_changes/deprecations/30737-TH.rst +++ /dev/null @@ -1,8 +0,0 @@ -The *canvas* parameter to ``MultiCursor`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -... is deprecated. It has been unused for a while already. - -Please remove the parameter and change the call from -``MultiCursor(canvas, axes)`` to ``MultiCursor(axes)``. Both calls are -valid throughout the deprecation period. diff --git a/doc/api/next_api_changes/deprecations/30844-IHI.rst b/doc/api/next_api_changes/deprecations/30844-IHI.rst deleted file mode 100644 index 55ebe9af6d68..000000000000 --- a/doc/api/next_api_changes/deprecations/30844-IHI.rst +++ /dev/null @@ -1,6 +0,0 @@ -``CallbackRegistry.disconnect`` *cid* parameter renamed to *cid_or_func* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The *cid* parameter of `.CallbackRegistry.disconnect` has been renamed to -*cid_or_func*. The method now also accepts a callable, which will disconnect -that callback from all signals or from a specific signal if the *signal* -keyword argument is provided. diff --git a/doc/api/next_api_changes/deprecations/30889-TH.rst b/doc/api/next_api_changes/deprecations/30889-TH.rst deleted file mode 100644 index d221ae30d4fb..000000000000 --- a/doc/api/next_api_changes/deprecations/30889-TH.rst +++ /dev/null @@ -1,10 +0,0 @@ -Transforms helper functions -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The following functions in the `.transforms` module are deprecated, -because they are considerer internal functionality and should not be used -by end users: - -- ``matplotlib.transforms.nonsingular`` -- ``matplotlib.transforms.interval_contains`` -- ``matplotlib.transforms.interval_contains_open`` diff --git a/doc/api/next_api_changes/deprecations/30993-SS.rst b/doc/api/next_api_changes/deprecations/30993-SS.rst deleted file mode 100644 index 152d25ba438d..000000000000 --- a/doc/api/next_api_changes/deprecations/30993-SS.rst +++ /dev/null @@ -1,5 +0,0 @@ -``InvertedSymmetricalLogTransform.invlinthresh`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The ``invlinthresh`` attribute of `.InvertedSymmetricalLogTransform` is -deprecated. Use the ``.inverted().transform(linthresh)`` method instead. diff --git a/doc/api/next_api_changes/deprecations/31023-AL.rst b/doc/api/next_api_changes/deprecations/31023-AL.rst deleted file mode 100644 index ac2e8be2e708..000000000000 --- a/doc/api/next_api_changes/deprecations/31023-AL.rst +++ /dev/null @@ -1,4 +0,0 @@ -``cbook.normalize_kwargs`` only supports passing artists and artist classes as second argument -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Support for directly passing an alias mapping or None as second argument to -`.cbook.normalize_kwargs` has been deprecated. diff --git a/doc/api/next_api_changes/deprecations/31143-AL.rst b/doc/api/next_api_changes/deprecations/31143-AL.rst deleted file mode 100644 index 7de02ff83896..000000000000 --- a/doc/api/next_api_changes/deprecations/31143-AL.rst +++ /dev/null @@ -1,3 +0,0 @@ -``backend_svg.XMLWriter`` is deprecated -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -It is an internal helper not intended for external use. diff --git a/doc/api/next_api_changes/deprecations/31170-AL.rst b/doc/api/next_api_changes/deprecations/31170-AL.rst deleted file mode 100644 index ecf1f31f1cff..000000000000 --- a/doc/api/next_api_changes/deprecations/31170-AL.rst +++ /dev/null @@ -1,6 +0,0 @@ -``kw``, ``fontproperties``, ``labelcolor``, and ``verts`` attributes of ``QuiverKey`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -These attributes are deprecated (note that ``fontproperties``, ``labelcolor``, -or ``verts`` after the first draw had no effect previously). Directly -access the relevant attributes on the sub-artists ``QuiverKey.vector`` and -``QuiverKey.text``, instead. diff --git a/doc/api/next_api_changes/deprecations/31248-SS.rst b/doc/api/next_api_changes/deprecations/31248-SS.rst deleted file mode 100644 index 1d7adbdf0fde..000000000000 --- a/doc/api/next_api_changes/deprecations/31248-SS.rst +++ /dev/null @@ -1,9 +0,0 @@ -Arbitrary code in ``axes.prop_cycle`` rcParam strings -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The ``axes.prop_cycle`` rcParam accepts Python expressions that are evaluated -in a limited context. The evaluation context has been further limited and some -expressions that previously worked (list comprehensions, for example) no longer -will. This change is made without a deprecation period to improve security. -The previously documented cycler operations at -https://matplotlib.org/cycler/ are still supported. diff --git a/doc/api/next_api_changes/deprecations/31347-TH.rst b/doc/api/next_api_changes/deprecations/31347-TH.rst deleted file mode 100644 index 991406e08b97..000000000000 --- a/doc/api/next_api_changes/deprecations/31347-TH.rst +++ /dev/null @@ -1,8 +0,0 @@ -Contour labelling on filled contours -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Using `~.Axes.clabel` to label filled contours created with `~.Axes.contourf` is deprecated. ``clabel()`` -is designed to label contour lines (`.Axes.contour`), and using it with filled contours can lead to inconsistent -plots. If you want to add labels to filled contours, the recommended approach is to first create the filled contours -with `~.Axes.contourf`, then overlay contour lines using `~.Axes.contour`, and finally apply `~.Axes.clabel` to those -contour lines for labeling. For an example see :doc:`/gallery/images_contours_and_fields/contourf_demo`. diff --git a/doc/api/next_api_changes/deprecations/31416-TH.rst b/doc/api/next_api_changes/deprecations/31416-TH.rst deleted file mode 100644 index 6d6d4b7b7809..000000000000 --- a/doc/api/next_api_changes/deprecations/31416-TH.rst +++ /dev/null @@ -1,8 +0,0 @@ -Formatter attributes -~~~~~~~~~~~~~~~~~~~~ - -These following attributes are considered internal and users should not have a need to access them: - -- `.ScalarFormatter`: ``orderOfMagnitude`` and ``format`` -- `.ConciseDateFormatter`: ``offset_format`` -- `.Formatter`: ``locs`` diff --git a/doc/api/next_api_changes/deprecations/31468-ES.rst b/doc/api/next_api_changes/deprecations/31468-ES.rst deleted file mode 100644 index a71644a6e4f5..000000000000 --- a/doc/api/next_api_changes/deprecations/31468-ES.rst +++ /dev/null @@ -1,6 +0,0 @@ -``image.thumbnail`` -~~~~~~~~~~~~~~~~~~~ - -... is deprecated without replacement. Use :external:py:`Pillow's thumbnail -method ` instead. See also the `Pillow tutorial -`_. diff --git a/doc/api/next_api_changes/deprecations/31521-ES.rst b/doc/api/next_api_changes/deprecations/31521-ES.rst deleted file mode 100644 index fc04b69a50fd..000000000000 --- a/doc/api/next_api_changes/deprecations/31521-ES.rst +++ /dev/null @@ -1,7 +0,0 @@ -Font hinting factor is deprecated -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Due to internal changes to support complex text rendering, the hinting factor on fonts is -no longer used. Setting the ``text.hinting_factor`` rcParam to any value other than None -is deprecated, and the rcParam will be removed in the future. Likewise, passing the -``hinting_factor`` argument to the `.FT2Font` constructor is deprecated. diff --git a/doc/api/next_api_changes/deprecations/31630-ES.rst b/doc/api/next_api_changes/deprecations/31630-ES.rst deleted file mode 100644 index 2509b4323022..000000000000 --- a/doc/api/next_api_changes/deprecations/31630-ES.rst +++ /dev/null @@ -1,10 +0,0 @@ -``apply_theta_transforms`` option in ``PolarTransform`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Applying theta transforms in `~matplotlib.projections.polar.PolarTransform` and -`~matplotlib.projections.polar.InvertedPolarTransform` has been removed, and the -*apply_theta_transforms* keyword argument is deprecated for both classes. - -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/development/29181-ES.rst b/doc/api/next_api_changes/development/29181-ES.rst deleted file mode 100644 index a3c7e5eed448..000000000000 --- a/doc/api/next_api_changes/development/29181-ES.rst +++ /dev/null @@ -1,11 +0,0 @@ -pip 25.1 suggested for development -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Dependencies for development (build and testing) are now specified as `Dependency Groups -`_ -instead of `individual requirements files -`_. - -Consequently, a version of pip that supports Dependency Groups is suggested, namely -version 25.1 or higher. Note that if you install build/testing dependencies manually (by -copying the list from ``pyproject.toml``), then an older version of pip is sufficient. diff --git a/doc/api/next_api_changes/development/29745-DS.rst b/doc/api/next_api_changes/development/29745-DS.rst deleted file mode 100644 index 7d9b1c2b143b..000000000000 --- a/doc/api/next_api_changes/development/29745-DS.rst +++ /dev/null @@ -1,4 +0,0 @@ -New minimum version of pyparsing -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The minimum required version of ``pyparsing`` has been updated from 2.3.1 to 3.0.0. diff --git a/doc/api/next_api_changes/development/30143-ES.rst b/doc/api/next_api_changes/development/30143-ES.rst deleted file mode 100644 index 2d79ad6bbe9d..000000000000 --- a/doc/api/next_api_changes/development/30143-ES.rst +++ /dev/null @@ -1,7 +0,0 @@ -Glyph indices now typed distinctly from character codes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Previously, character codes and glyph indices were both typed as `int`, which means you -could mix and match them erroneously. While the character code can't be made a distinct -type (because it's used for `chr`/`ord`), typing glyph indices as a distinct type means -these can't be fully swapped. diff --git a/doc/api/next_api_changes/removals/29697-REC.rst b/doc/api/next_api_changes/removals/29697-REC.rst deleted file mode 100644 index 0155578f0c21..000000000000 --- a/doc/api/next_api_changes/removals/29697-REC.rst +++ /dev/null @@ -1,10 +0,0 @@ -``plot_date`` -~~~~~~~~~~~~~ - -Use of ``plot_date`` has been discouraged since Matplotlib 3.5 and deprecated -since 3.9. The ``plot_date`` function has now been removed. - -- ``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/removals/30005-DS.rst b/doc/api/next_api_changes/removals/30005-DS.rst deleted file mode 100644 index a5ba482c848f..000000000000 --- a/doc/api/next_api_changes/removals/30005-DS.rst +++ /dev/null @@ -1,11 +0,0 @@ -``matplotlib.cm.get_cmap`` -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Colormaps are now available through the `.ColormapRegistry` accessible via -`matplotlib.colormaps` or `matplotlib.pyplot.colormaps`. - -If you have the name of a colormap as a string, you can use a direct lookup, -``matplotlib.colormaps[name]`` or ``matplotlib.pyplot.colormaps[name]`` . Alternatively, ``matplotlib.colormaps.get_cmap`` will -maintain the existing behavior of additionally passing through `.Colormap` instances -and converting ``None`` to the default colormap. `matplotlib.pyplot.get_cmap` will stay as a -shortcut to ``matplotlib.colormaps.get_cmap``. diff --git a/doc/api/next_api_changes/removals/30014-DS.rst b/doc/api/next_api_changes/removals/30014-DS.rst deleted file mode 100644 index d13737f17e40..000000000000 --- a/doc/api/next_api_changes/removals/30014-DS.rst +++ /dev/null @@ -1,4 +0,0 @@ -``GridHelperCurveLinear.get_tick_iterator`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -... is removed with no replacement. diff --git a/doc/api/next_api_changes/removals/30015-DS.rst b/doc/api/next_api_changes/removals/30015-DS.rst deleted file mode 100644 index e5f17518a9f3..000000000000 --- a/doc/api/next_api_changes/removals/30015-DS.rst +++ /dev/null @@ -1,9 +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. -That parameter is entirely inferred from the (required) *loc* parameter. - -For curvilinear axes, the *nth_coord* parameter remains supported (it affects -the *ticks*, not the axis position itself), but it is now keyword-only. diff --git a/doc/api/next_api_changes/removals/30067-OG.rst b/doc/api/next_api_changes/removals/30067-OG.rst deleted file mode 100644 index 1a8d8bc5c2c5..000000000000 --- a/doc/api/next_api_changes/removals/30067-OG.rst +++ /dev/null @@ -1,23 +0,0 @@ -``TransformNode.is_bbox`` -^^^^^^^^^^^^^^^^^^^^^^^^^ - -... is removed. Instead check the object using ``isinstance(..., BboxBase)``. - -``rcsetup.interactive_bk``, ``rcsetup.non_interactive_bk`` and ``rcsetup.all_backends`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -... are removed and replaced by ``matplotlib.backends.backend_registry.list_builtin`` -with the following arguments - -- ``matplotlib.backends.BackendFilter.INTERACTIVE`` -- ``matplotlib.backends.BackendFilter.NON_INTERACTIVE`` -- ``None`` - -``BboxTransformToMaxOnly`` -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -... is removed. It can be replaced by ``BboxTransformTo(LockableBbox(bbox, x0=0, y0=0))``. - -*interval* parameter of ``TimerBase.start`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The timer interval parameter can no longer be set while starting it. 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/removals/31588-ES.rst b/doc/api/next_api_changes/removals/31588-ES.rst deleted file mode 100644 index 8709c5a77f5f..000000000000 --- a/doc/api/next_api_changes/removals/31588-ES.rst +++ /dev/null @@ -1,18 +0,0 @@ -``boxplot`` tick labels -^^^^^^^^^^^^^^^^^^^^^^^ - -The parameter *labels* has been removed in favour of *tick_labels* for clarity and -consistency with `~.Axes.bar`. - -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 -has been removed; 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.11.0.rst b/doc/api/prev_api_changes/api_changes_3.11.0.rst new file mode 100644 index 000000000000..63a725b7854c --- /dev/null +++ b/doc/api/prev_api_changes/api_changes_3.11.0.rst @@ -0,0 +1,14 @@ +API Changes for 3.11.0 +====================== + +.. contents:: + :local: + :depth: 1 + +.. include:: /api/prev_api_changes/api_changes_3.10.0/behavior.rst + +.. include:: /api/prev_api_changes/api_changes_3.10.0/deprecations.rst + +.. include:: /api/prev_api_changes/api_changes_3.10.0/removals.rst + +.. include:: /api/prev_api_changes/api_changes_3.10.0/development.rst diff --git a/doc/api/prev_api_changes/api_changes_3.11.0/behaviour.rst b/doc/api/prev_api_changes/api_changes_3.11.0/behaviour.rst new file mode 100644 index 000000000000..c592cad7ebdd --- /dev/null +++ b/doc/api/prev_api_changes/api_changes_3.11.0/behaviour.rst @@ -0,0 +1,199 @@ +``pyplot.subplot`` and ``pyplot.subplot_mosaic`` raise *ValueError* on existing figures +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Passing a *num* argument to `~.pyplot.subplots` or `~.pyplot.subplot_mosaic` that refers +to an existing figure or is a ``Figure`` instance now raises a `ValueError`. + +These utility functions are intended strictly for the creation of new figures and +subplots. Previously, they accidentally allowed the reuse of existing figures because +they internally called `~.pyplot.figure`. This change ensures that these functions +strictly follow their documented purpose of creating new figures. + +To reuse an existing figure, clear it first using ``clear=True``: + +.. code-block:: python + + fig, axs = plt.subplots(num=1, clear=True) + # or + fig, axd = plt.subplot_mosaic([['A', 'B']], num=1, clear=True) + +If you have a ``Figure`` instance and want to add subplots to it, use the +object-oriented API: + +.. code-block:: python + + fig.subplots(nrows=2, ncols=2) + # or + fig.subplot_mosaic([['A', 'B']]) + +Complex layouts and constrained layout +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Constrained layout now produces smaller spacing between subplots in some circumstances. +This should only affect complex layouts where rows or columns contain different numbers +of subplots, for example a layout created with ``plt.subplot_mosaic('AC;BC', +layout='constrained')``. + +Bivariate colormaps now fully span the intended range of colors +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Bivariate colormaps generated by ``SegmentedBivarColormap`` (e.g., ``BiOrangeBlue``) +from a set of input colors now fully span that range of colors. There had been a bug +with the numerical interpolation such that the colormap did not actually include the +first or last colors. + +Rendering of images now more accurate +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +There have been several fixes to improve the accuracy of how images are resampled and +placed during rendering. Some inaccuracies were up to a pixel off in the output. The +most apparent improvement is that the alignment of data pixels with tick marks and grid +lines is now reliable. Nearly all image output has changed, but often only at a subtle +level that is not obvious qualitatively. + +*alpha* parameter handling on images +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Prior to Matplotlib 3.10.1, when passing an array to ``imshow(..., alpha=...)``, the +parameter was silently ignored if the image data was an RGB or RGBA image or if +:rc:`image.interpolation_stage` resolved to "rbga". + +Matplotlib 3.10.1 changed this to apply the alpha array as the alpha channel, +overwriting any existing transparency information in the image data. Matplotlib 3.11.0 +further fixes the handling for RGBA images: the existing alpha channel is now multiplied +by the alpha array, consistent with how scalar alpha values are handled. + +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 length is not one an error is raised. To keep the old +behavior, cast the sequence to string before passing. + +Mixing positional and keyword arguments for ``legend`` handles and labels... +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +... is no longer valid. If passing *handles* and *labels* to ``legend``, they must now +be passed either both positionally or both as keyword arguments. + +``Axes.add_collection(..., autolim=True)`` updates view limits +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +``Axes.add_collection(..., autolim=True)`` has so far only updated the data limits, and +calling `.Axes.autoscale_view` was also necessary to update the view limits. View limits +are now updated as well if ``autolim=True``, using a lazy internal update mechanism, so +that the costs only apply once also if you add multiple collections. + +``relim()`` now accounts for Collection artists +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Previously, `~.axes.Axes.relim` did not recalculate data limits for `.Collection` +artists (e.g. those created by `~.axes.Axes.scatter`). Calling ``ax.relim()`` followed +by ``ax.autoscale_view()`` now correctly includes scatter plots and other collections in +the axes limits. + +hist2d no longer forces axes limits +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Previously, `.Axes.hist2d` would force the axes x and y limits to the extents of the +histogrammed data, ignoring any other artists. `.Axes.hist2d` now behaves similarly to +`.Axes.imshow`: axes limits are updated to fit the data, but autoscaling is not +otherwise disabled. + +Minor log tick labels are set by number of major log ticks, not number of decades spanned +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Previously, by default, on a log-scaled axis, the minor ticks would be unlabeled if the +axis limits spanned more than one decade. The meaning of the *minor_thresholds* +parameter to `.LogFormatter` has been altered so that the decision of whether to label +the minor ticks is now based on the number of major ticks drawn within the axis limits. + +For example, for an axis spanning from 4 to 60 (with thus a single major log tick, at +10), minor ticks are now labeled, even though the axis spans more than one decade. + +Setting titles of figures using webagg backend +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Previously when using the ``webagg`` backend the title of a figure was set using +``figure.set_label``. Now it is set using ``figure.canvas.manager.set_window_title`` +which is more consistent with other backends. + +Default name of ``ListedColormap`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The default name of `.ListedColormap` has changed from "from_list" to "unnamed". + +``font_manager.findfont`` logs if selected font weight does not match requested +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When searching for a font with a weight specified, if the best-matched font differs in +weight, then a warning will be logged. + +FT2Font no longer sets a default size +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In the interest of handling non-scalable fonts and reducing font initialization, the +`.FT2Font` constructor no longer sets a default size. Non-scalable fonts are sometimes +used for bitmap-backed emoji fonts. + +If metrics are important (i.e., if you are loading character glyphs, or setting a text +string), then explicitly call `.FT2Font.set_size` beforehand. + +``mathtext.VectorParse`` now includes glyph indices +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +For a *path*-outputting `.MathTextParser`, in the return value of +`~.MathTextParser.parse`, (a `.VectorParse`), the *glyphs* field is now a list +containing tuples of: + +- font: `.FT2Font` +- fontsize: `float` +- character code: `int` +- glyph index: `int` +- x: `float` +- y: `float` + +Specifically, the glyph index was added after the character code. + +New environment variable to ignore system fonts +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +System fonts may be ignored by setting the :envvar:`MPL_IGNORE_SYSTEM_FONTS`; this +suppresses searching for system fonts (in known directories or via some +platform-specific subprocess) as well as limiting the results from +`.FontManager.findfont`. + +SVG links open in new tab or window +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`.Artist.set_url` allows to turn the Artist into a link. In SVG output, this has been +implemented without specifying a `target`_ attribute. The default target value "_self" +resulted in replacing the SVG document with the linked page when the link was clicked. + +The target is now set to "_blank" so that the link opens in a new tab or window. + +.. _target: https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/target + +``matplotlib.testing.check_figures_equal`` defaults to PNG only +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In most cases, checking that figures are equal with `.check_figures_equal` does not +depend on the file format. Consequently, the *extensions* parameter now defaults to +``['png']`` instead of ``['png', 'pdf', 'svg']``, reducing default test requirements. + +Default *style* parameter of ``image_comparison`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The *style* parameter of the `.image_comparison` decorator will become 'mpl20' in +Matplotlib 3.13. Not passing it and relying on the previous default will warn until the +change occurs. + +Windows configuration directory location +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +On Windows, the default configuration and cache directories now use +``%LOCALAPPDATA%\matplotlib`` instead of ``%USERPROFILE%\.matplotlib``. This follows +Windows application data storage conventions. + +The ``MPLCONFIGDIR`` environment variable can still be used to override this default. diff --git a/doc/api/prev_api_changes/api_changes_3.11.0/deprecations.rst b/doc/api/prev_api_changes/api_changes_3.11.0/deprecations.rst new file mode 100644 index 000000000000..8c53fe594c06 --- /dev/null +++ b/doc/api/prev_api_changes/api_changes_3.11.0/deprecations.rst @@ -0,0 +1,289 @@ +In-place modification of colormaps +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Colormaps are planned to become immutable in the long term. + +As a first step, in-place modifications of colormaps are now pending-deprecated. This +affects the following methods of `.Colormap`: + +- `.Colormap.set_bad` - use ``cmap.with_extremes(bad=...)`` instead +- `.Colormap.set_under` - use ``cmap.with_extremes(under=...)`` instead +- `.Colormap.set_over` - use ``cmap.with_extremes(over=...)`` instead +- `.Colormap.set_extremes` - use ``cmap.with_extremes(...)`` instead + +Use the respective `.Colormap.with_extremes` and appropriate keyword arguments instead +which returns a copy of the colormap (available since Matplotlib 3.4). Alternatively, if +you create the colormap yourself, you can also pass the respective arguments to the +constructor (available since Matplotlib 3.11). + +Contour labelling on filled contours +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Using `~.Axes.clabel` to label filled contours created with `~.Axes.contourf` is +deprecated. ``clabel()`` is designed to label contour lines (`.Axes.contour`), and using +it with filled contours can lead to inconsistent plots. If you want to add labels to +filled contours, the recommended approach is to first create the filled contours with +`~.Axes.contourf`, then overlay contour lines using `~.Axes.contour`, and finally apply +`~.Axes.clabel` to those contour lines for labeling. For an example see +:doc:`/gallery/images_contours_and_fields/contourf_demo`. + +``boxplot`` and ``bxp`` *vert* parameter, and ``rcParams["boxplot.vertical"]`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The parameter *vert: bool* has been deprecated on `~.Axes.boxplot` and `~.Axes.bxp`. It +is replaced by *orientation: {"vertical", "horizontal"}* for API consistency. + +``rcParams["boxplot.vertical"]``, which controlled the orientation of ``boxplot``, is +deprecated without replacement. + +``violinplot`` and ``violin`` *vert* parameter +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The parameter *vert: bool* has been deprecated on `~.Axes.violinplot` and +`~.Axes.violin`. It will be replaced by *orientation: {"vertical", "horizontal"}* for +API consistency. + +Arbitrary code in ``axes.prop_cycle`` rcParam strings +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``axes.prop_cycle`` rcParam accepts Python expressions that are evaluated in a +limited context. The evaluation context has been further limited and some expressions +that previously worked (list comprehensions, for example) no longer will. This change is +made without a deprecation period to improve security. The previously documented cycler +operations at https://matplotlib.org/cycler/ are still supported. + +Capitalization of None in matplotlibrc +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In :file:`matplotlibrc` config files every capitalization of None was accepted for +denoting the Python constant `None`. This is now deprecated, and the only accepted +capitalization is None, i.e., starting with a capital letter and all other letters in +lowercase. + +Third-party scales no longer need to have an *axis* parameter +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Since Matplotlib 3.1 `PR 12831 `_ +scale objects should be reusable and therefore independent of any particular Axis. +Therefore, the use of the *axis* parameter in the ``__init__`` had been discouraged. +However, having that parameter in the signature was still necessary for API +backwards-compatibility. This is no longer the case. + +`.register_scale` now accepts scale classes with or without this parameter. + +The *axis* parameter is pending-deprecated. It will be deprecated in Matplotlib 3.13, +and removed in Matplotlib 3.15. + +Third-party scales are recommended to remove the *axis* parameter now if they can afford +to restrict compatibility to Matplotlib >= 3.11 already. Otherwise, they may keep the +*axis* parameter and remove it in time for Matplotlib 3.13. + +``matplotlib.style.core`` +~~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``matplotlib.style.core`` module is deprecated. All APIs intended for public use are +now available in `matplotlib.style` directly (including ``USER_LIBRARY_PATHS``, which +was previously not reexported). + +The following APIs of ``matplotlib.style.core`` have been deprecated with no +replacement: ``BASE_LIBRARY_PATH``, ``STYLE_EXTENSION``, ``STYLE_BLACKLIST``, +``update_user_library``, ``read_style_directory``, ``update_nested_dict``. + +Font hinting and kerning factors +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Due to internal changes to support complex text rendering, the hinting factor and +kerning factor on fonts are no longer used. Setting the ``text.hinting_factor`` or +``text.kerning_factor`` rcParams (the latter of which existed only for +backwards-compatibility) to any value other than None is deprecated, and they will be +removed in the future. + +Likewise, passing the ``hinting_factor`` argument to the `.FT2Font` constructor is +deprecated. + +``FT2Image`` image buffer +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Use 2D uint8 ndarrays instead. In particular: + +- The ``FT2Image`` constructor took ``width, height`` as separate parameters but the + ndarray constructor takes ``(height, width)`` as single tuple parameter. +- `.FT2Font.draw_glyph_to_bitmap` now (also) takes 2D uint8 arrays as input. +- ``FT2Image.draw_rect_filled`` should be replaced by directly setting pixel values to + black. +- The ``image`` attribute of the object returned by ``MathTextParser("agg").parse`` is + now a 2D uint8 array. + +``DviFont.widths`` +~~~~~~~~~~~~~~~~~~ + +... is deprecated with no replacement. + +``PdfFile`` internals +~~~~~~~~~~~~~~~~~~~~~ + +The ``PdfFile.dviFontInfo``, ``PdfFile.fontNames``, ``PdfFile.multi_byte_charprocs``, +and ``PdfFile.type1Descriptors`` attributes are deprecated with no replacement. + +The *fontfile* parameter of ``PdfFile.createType1Descriptor`` is deprecated; all +relevant pieces of information are now directly extracted from the *t1font* argument. + +``Tfm``'s internal metrics +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Direct access to ``Tfm``'s ``widths``, ``heights``, ``depths`` dicts is deprecated; +access a glyph's metrics with `.Tfm.get_metrics` instead. + +``font_manager.is_opentype_cff_font`` is deprecated +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +There is no replacement. + +``Axes.set_navigate_mode`` is deprecated +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +... with no replacement. + +Parameters ``Axes3D.set_aspect(..., anchor=..., share=...)`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The parameters *anchor* and *share* of `.Axes3D.set_aspect` are deprecated. They had no +effect on 3D axes and will be removed in a future version. + +``BezierSegment.point_at_t`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +... is deprecated. Instead, it is possible to call the BezierSegment with an argument. + +Formatter attributes +~~~~~~~~~~~~~~~~~~~~ + +These following attributes are considered internal and users should not have a need to +access them: + +- `.ScalarFormatter`: ``orderOfMagnitude`` and ``format`` +- `.ConciseDateFormatter`: ``offset_format`` +- `.Formatter`: ``locs`` + +Parameter ``ListedColormap(..., N=...)`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Passing the parameter *N* to `.ListedColormap` is deprecated. Please preprocess the list +colors yourself if needed. + +``kw``, ``fontproperties``, ``labelcolor``, and ``verts`` attributes of ``QuiverKey`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +These attributes are deprecated (note that modifying ``fontproperties``, ``labelcolor``, +or ``verts`` after the first draw had no effect previously). Directly access the +relevant attributes on the sub-artists ``QuiverKey.vector`` and ``QuiverKey.text``, +instead. + +``apply_theta_transforms`` option in ``PolarTransform`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Applying theta transforms in `~matplotlib.projections.polar.PolarTransform` and +`~matplotlib.projections.polar.InvertedPolarTransform` has been removed, and the +*apply_theta_transforms* keyword argument is deprecated for both classes. + +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. + +*axes* parameter of ``RadialLocator`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +... is deprecated. `~.polar.RadialLocator` now fetches the relevant information from the +Axis' parent Axes. + +Transform helper functions +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The following functions in the `.transforms` module are deprecated, because they are +considerer internal functionality and should not be used by end users: + +- ``matplotlib.transforms.nonsingular`` +- ``matplotlib.transforms.interval_contains`` +- ``matplotlib.transforms.interval_contains_open`` + +``InvertedSymmetricalLogTransform.invlinthresh`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``invlinthresh`` attribute of `.InvertedSymmetricalLogTransform` is deprecated. Use +the ``.inverted().transform(linthresh)`` method instead. + +:mod:`.axisartist` now uses more standard tick direction controls +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Previously, the position of :mod:`.axisartist` ticks (inside or outside the axes) were +set using ``set_tick_out(bool)``. They are now set using ``set_tick_direction("in")`` +(or "out", or "inout"), and respect :rc:`xtick.direction` and :rc:`ytick.direction`. In +particular, they default to pointing outwards, consistently with the rest of the +library. + +The *tick_out* parameter of `.Ticks` has been deprecated (use *tick_direction* instead). +The ``Ticks.get_tick_out`` method is deprecated (use `.Ticks.get_tick_direction` +instead). + +The unused ``locs_angles_labels`` attribute of `.Ticks` and `.LabelBase` has also been +deprecated. + +``GridFinder.get_grid_info`` now takes a single bbox as parameter +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Passing ``x1, y1, x2, y2`` as separate parameters is deprecated. + +``GridFinder.transform_xy`` and ``GridFinder.inv_transform_xy`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +... are deprecated. Directly use the standard transform returned by +`.GridFinder.get_transform` instead. + +``axes_grid.Grid.ngrids`` +~~~~~~~~~~~~~~~~~~~~~~~~~ + +This attribute has been deprecated and renamed ``n_axes``, consistently with the new +name of the `~.axes_grid.Grid` constructor parameter that allows setting the actual +number of axes in the grid (the old parameter, ``ngrids``, did not actually work since +Matplotlib 3.3). + +The same change has been made in ``axes_grid.ImageGrid``. + +*canvas* parameter to ``MultiCursor`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +... is deprecated. It has been unused for a while already. + +Please remove the parameter and change the call from ``MultiCursor(canvas, axes)`` to +``MultiCursor(axes)``. Both calls are valid throughout the deprecation period. + +``CallbackRegistry.disconnect`` *cid* parameter renamed to *cid_or_func* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The *cid* parameter of `.CallbackRegistry.disconnect` has been renamed to *cid_or_func*. +The method now also accepts a callable, which will disconnect that callback from all +signals or from a specific signal if the *signal* keyword argument is provided. + +``cbook.normalize_kwargs`` only supports passing artists and artist classes as second argument +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Support for directly passing an alias mapping or None as second argument to +`.cbook.normalize_kwargs` has been deprecated. + +``backend_svg.XMLWriter`` is deprecated +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It is an internal helper not intended for external use. + +``image.thumbnail`` +~~~~~~~~~~~~~~~~~~~ + +... is deprecated without replacement. Use :external:py:`Pillow's thumbnail method +` instead. See also the `Pillow tutorial +`_. + +``testing.widgets.mock_event`` and ``testing.widgets.do_event`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +... are deprecated. Directly construct Event objects (typically `.MouseEvent` or +`.KeyEvent`) and pass them to ``canvas.callbacks.process()`` instead. diff --git a/doc/api/prev_api_changes/api_changes_3.11.0/development.rst b/doc/api/prev_api_changes/api_changes_3.11.0/development.rst new file mode 100644 index 000000000000..44efd0586d75 --- /dev/null +++ b/doc/api/prev_api_changes/api_changes_3.11.0/development.rst @@ -0,0 +1,36 @@ +Increase to minimum supported versions of dependencies +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +For Matplotlib 3.11, the :ref:`minimum supported versions ` are being +bumped: + ++------------+-----------------+----------------+ +| Dependency | min in mpl3.10 | min in mpl3.11 | ++============+=================+================+ +| Python | 3.10 | 3.11 | +| NumPy | 1.23 | 1.25 | +| pyparsing | 2.3.1 | 3.0.0 | ++------------+-----------------+----------------+ + +This is consistent with our :ref:`min_deps_policy` and `SPEC0 +`__ + +pip 25.1 suggested for development +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Dependencies for development (build and testing) are now specified as `Dependency Groups +`_ +instead of `individual requirements files +`_. + +Consequently, a version of pip that supports Dependency Groups is suggested, namely +version 25.1 or higher. Note that if you install build/testing dependencies manually (by +copying the list from ``pyproject.toml``), then an older version of pip is sufficient. + +Glyph indices now typed distinctly from character codes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Previously, character codes and glyph indices were both typed as `int`, which means you +could mix and match them erroneously. While the character code can't be made a distinct +type (because it's used for `chr`/`ord`), typing glyph indices as a distinct type means +these can't be fully swapped. diff --git a/doc/api/prev_api_changes/api_changes_3.11.0/removals.rst b/doc/api/prev_api_changes/api_changes_3.11.0/removals.rst new file mode 100644 index 000000000000..74f0d7f3a19d --- /dev/null +++ b/doc/api/prev_api_changes/api_changes_3.11.0/removals.rst @@ -0,0 +1,83 @@ +``matplotlib.cm.get_cmap`` +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Colormaps are now available through the `.ColormapRegistry` accessible via +`matplotlib.colormaps` or `matplotlib.pyplot.colormaps`. + +If you have the name of a colormap as a string, you can use a direct lookup, +``matplotlib.colormaps[name]`` or ``matplotlib.pyplot.colormaps[name]``. Alternatively, +``matplotlib.colormaps.get_cmap`` will maintain the existing behavior of additionally +passing through `.Colormap` instances and converting ``None`` to the default colormap. +`matplotlib.pyplot.get_cmap` will stay as a shortcut to +``matplotlib.colormaps.get_cmap``. + +``boxplot`` tick labels +^^^^^^^^^^^^^^^^^^^^^^^ + +The parameter *labels* has been removed in favour of *tick_labels* for clarity and +consistency with `~.Axes.bar`. + +``plot_date`` +~~~~~~~~~~~~~ + +Use of ``plot_date`` has been discouraged since Matplotlib 3.5 and deprecated since 3.9. +The ``plot_date`` function has now been removed. + +- ``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`. + +``GridHelperCurveLinear.get_tick_iterator`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +... is removed with no replacement. + +*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. +That parameter is entirely inferred from the (required) *loc* parameter. + +For curvilinear axes, the *nth_coord* parameter remains supported (it affects +the *ticks*, not the axis position itself), but it is now keyword-only. + +``rcsetup.interactive_bk``, ``rcsetup.non_interactive_bk`` and ``rcsetup.all_backends`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +... are removed and replaced by ``matplotlib.backends.backend_registry.list_builtin`` +with the following arguments + +- ``matplotlib.backends.BackendFilter.INTERACTIVE`` +- ``matplotlib.backends.BackendFilter.NON_INTERACTIVE`` +- ``None`` + +*interval* parameter of ``TimerBase.start`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The timer interval parameter can no longer be set while starting it. The interval can be +specified instead in the timer constructor, or by setting the timer.interval attribute. + +``TransformNode.is_bbox`` +~~~~~~~~~~~~~~~~~~~~~~~~~ + +... is removed. Instead check the object using ``isinstance(..., BboxBase)``. + +``BboxTransformToMaxOnly`` +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +... is removed. It can be replaced by ``BboxTransformTo(LockableBbox(bbox, x0=0, y0=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 +has been removed; 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/release/release_notes.rst b/doc/release/release_notes.rst index d652f5dbcf0f..cbceb4978121 100644 --- a/doc/release/release_notes.rst +++ b/doc/release/release_notes.rst @@ -18,6 +18,7 @@ Version 3.11 .. toctree:: :maxdepth: 1 + ../api/prev_api_changes/api_changes_3.11.0.rst github_stats.rst Version 3.10 diff --git a/galleries/examples/misc/hyperlinks_sgskip.py b/galleries/examples/misc/hyperlinks_sgskip.py index 26421c941573..ea2870aeae3d 100644 --- a/galleries/examples/misc/hyperlinks_sgskip.py +++ b/galleries/examples/misc/hyperlinks_sgskip.py @@ -20,6 +20,11 @@ s.set_urls(['https://www.bbc.com/news', 'https://www.google.com/', None]) fig.savefig('scatter.svg') +# %% +# .. raw:: html +# +# + # %% fig = plt.figure() @@ -35,3 +40,8 @@ im.set_url('https://www.google.com/') fig.savefig('image.svg') + +# %% +# .. raw:: html +# +# diff --git a/galleries/examples/pyplots/pyplot_simple.py b/galleries/examples/pyplots/pyplot_simple.py index 48a862c7fee3..8da1e346c296 100644 --- a/galleries/examples/pyplots/pyplot_simple.py +++ b/galleries/examples/pyplots/pyplot_simple.py @@ -1,20 +1,30 @@ """ -=========== -Simple plot -=========== +========== +Basic plot +========== -A simple plot where a list of numbers are plotted against their index, -resulting in a straight line. Use a format string (here, 'o-r') to set the -markers (circles), linestyle (solid line) and color (red). +A basic plot using the :ref:`pyplot_interface`. + +- `~.pyplot.plot` plots the data y versus x as lines and/or markers. +- `~.pyplot.title`, `~.pyplot.xlabel` and `~.pyplot.ylabel` set the title, + x-axis label and y-axis label. +- `~.pyplot.show` displays the plot. .. redirect-from:: /gallery/pyplots/fig_axes_labels_simple .. redirect-from:: /gallery/pyplots/pyplot_formatstr +.. redirect-from:: /gallery/pyplots/pyplot_text """ import matplotlib.pyplot as plt +import numpy as np + +x = np.arange(0.0, 2.0, 0.01) +y = np.sin(2 * np.pi * x) -plt.plot([1, 2, 3, 4], 'o-r') -plt.ylabel('some numbers') +plt.plot(x, y) +plt.title("A basic plot using pyplot") +plt.xlabel('Time [s]') +plt.ylabel('Voltage [mV]') plt.show() # %% @@ -25,5 +35,7 @@ # in this example: # # - `matplotlib.pyplot.plot` +# - `matplotlib.pyplot.title` +# - `matplotlib.pyplot.ylabel` # - `matplotlib.pyplot.ylabel` # - `matplotlib.pyplot.show` diff --git a/galleries/examples/pyplots/pyplot_text.py b/galleries/examples/pyplots/pyplot_text.py deleted file mode 100644 index 72f977c2f985..000000000000 --- a/galleries/examples/pyplots/pyplot_text.py +++ /dev/null @@ -1,41 +0,0 @@ -""" -============================== -Text and mathtext using pyplot -============================== - -Set the special text objects `~.pyplot.title`, `~.pyplot.xlabel`, and -`~.pyplot.ylabel` through the dedicated pyplot functions. Additional text -objects can be placed in the Axes using `~.pyplot.text`. - -You can use TeX-like mathematical typesetting in all texts; see also -:ref:`mathtext`. - -.. redirect-from:: /gallery/pyplots/pyplot_mathtext -""" - -import matplotlib.pyplot as plt -import numpy as np - -t = np.arange(0.0, 2.0, 0.01) -s = np.sin(2*np.pi*t) - -plt.plot(t, s) -plt.text(0, -1, r'Hello, world!', fontsize=15) -plt.title(r'$\mathcal{A}\sin(\omega t)$', fontsize=20) -plt.xlabel('Time [s]') -plt.ylabel('Voltage [mV]') -plt.show() - -# %% -# -# .. admonition:: References -# -# The use of the following functions, methods, classes and modules is shown -# in this example: -# -# - `matplotlib.pyplot.hist` -# - `matplotlib.pyplot.xlabel` -# - `matplotlib.pyplot.ylabel` -# - `matplotlib.pyplot.text` -# - `matplotlib.pyplot.grid` -# - `matplotlib.pyplot.show` diff --git a/galleries/examples/pyplots/pyplot_three.py b/galleries/examples/pyplots/pyplot_three.py deleted file mode 100644 index b14998cca4c9..000000000000 --- a/galleries/examples/pyplots/pyplot_three.py +++ /dev/null @@ -1,26 +0,0 @@ -""" -=========================== -Multiple lines using pyplot -=========================== - -Plot three datasets with a single call to `~matplotlib.pyplot.plot`. -""" - -import matplotlib.pyplot as plt -import numpy as np - -# evenly sampled time at 200ms intervals -t = np.arange(0., 5., 0.2) - -# red dashes, blue squares and green triangles -plt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^') -plt.show() - -# %% -# -# .. admonition:: References -# -# The use of the following functions, methods, classes and modules is shown -# in this example: -# -# - `matplotlib.axes.Axes.plot` / `matplotlib.pyplot.plot` diff --git a/galleries/examples/pyplots/pyplot_two_subplots.py b/galleries/examples/pyplots/pyplot_two_subplots.py index 2eb0237d5521..b532c7b1534d 100644 --- a/galleries/examples/pyplots/pyplot_two_subplots.py +++ b/galleries/examples/pyplots/pyplot_two_subplots.py @@ -3,7 +3,18 @@ Two subplots using pyplot ========================= -Create a figure with two subplots using `.pyplot.subplot`. +A typical pyplot usage pattern is to create subplots incrementally through +`~.pyplot.subplot`. + +The three-digit number passed to `~.pyplot.subplot` specifies the position of +the subplot in the grid of subplots. ``211`` means "in a grid of 2 rows and 1 column, +create this subplot in the 1st position". ``212`` likewise means "in a grid of 2 +rows and 1 column, create this subplot in the 2nd position". + +After calling ``subplot()`` all following pyplot commands will modify that subplot +until a new subplot is created. + +.. redirect-from:: /gallery/pyplots/pyplot_three """ import matplotlib.pyplot as plt @@ -21,9 +32,11 @@ def f(t): plt.subplot(211) plt.plot(t1, f(t1), color='tab:blue', marker='o') plt.plot(t2, f(t2), color='black') +plt.title("Subplot 1") plt.subplot(212) plt.plot(t2, np.cos(2*np.pi*t2), color='tab:orange', linestyle='--') +plt.title("Subplot 2") plt.show() # %% diff --git a/galleries/examples/ticks/colorbar_tick_labelling_demo.py b/galleries/examples/ticks/colorbar_tick_labelling_demo.py index 6436748a46ec..30d2dbe274ce 100644 --- a/galleries/examples/ticks/colorbar_tick_labelling_demo.py +++ b/galleries/examples/ticks/colorbar_tick_labelling_demo.py @@ -1,6 +1,6 @@ """ ======================= -Colorbar Tick Labelling +Colorbar Tick labelling ======================= Vertical colorbars have ticks, tick labels, and labels visible on the *y* axis, diff --git a/galleries/examples/ticks/date_demo_convert.py b/galleries/examples/ticks/date_demo_convert.py index c22edf54df9a..a3c7a25b5fc0 100644 --- a/galleries/examples/ticks/date_demo_convert.py +++ b/galleries/examples/ticks/date_demo_convert.py @@ -1,9 +1,9 @@ """ -================= -Date Demo Convert -================= - +=================== +Date converter demo +=================== """ + import datetime import matplotlib.pyplot as plt @@ -21,14 +21,13 @@ fig, ax = plt.subplots() ax.plot(dates, y**2, 'o') -# this is superfluous, since the autoscaler should get it right, but +# This is superfluous, since the autoscaler should get it right, but # use date2num and num2date to convert between dates and floats if -# you want; both date2num and num2date convert an instance or sequence +# you want; both date2num and num2date convert an instance or sequence. ax.set_xlim(dates[0], dates[-1]) # The hour locator takes the hour or sequence of hours you want to -# tick, not the base multiple - +# tick, not the base multiple. ax.xaxis.set_major_locator(DayLocator()) ax.xaxis.set_minor_locator(HourLocator(range(0, 25, 6))) ax.xaxis.set_major_formatter(DateFormatter('%Y-%m-%d')) diff --git a/galleries/examples/ticks/fig_axes_customize_simple.py b/galleries/examples/ticks/fig_axes_customize_simple.py index 07a569e3d31d..72c36c7a96cc 100644 --- a/galleries/examples/ticks/fig_axes_customize_simple.py +++ b/galleries/examples/ticks/fig_axes_customize_simple.py @@ -1,7 +1,7 @@ """ -========================= -Fig Axes Customize Simple -========================= +====================================== +Customizing figure and axes appearance +====================================== Customize the background, labels and ticks of a simple plot. diff --git a/galleries/tutorials/artists.py b/galleries/tutorials/artists.py index 4f93f7c71a6e..b3440d71fe7f 100644 --- a/galleries/tutorials/artists.py +++ b/galleries/tutorials/artists.py @@ -38,12 +38,7 @@ helper methods to create the primitives. In the example below, we create a ``Figure`` instance using :func:`matplotlib.pyplot.figure`, which is a convenience method for instantiating ``Figure`` instances and connecting them -with your user interface or drawing toolkit ``FigureCanvas``. As we will -discuss below, this is not necessary -- you can work directly with PostScript, -PDF Gtk+, or wxPython ``FigureCanvas`` instances, instantiate your ``Figures`` -directly and connect them yourselves -- but since we are focusing here on the -``Artist`` API we'll let :mod:`~matplotlib.pyplot` handle some of those details -for us:: +with a GUI framework so that they can be shown in a window on the screen:: import matplotlib.pyplot as plt fig = plt.figure() @@ -94,9 +89,8 @@ class in the Matplotlib API, and the one you will be working with most In [102]: line Out[102]: -If you make subsequent calls to ``ax.plot`` (and the hold state is "on" -which is the default) then additional lines will be added to the list. -You can remove a line later by calling its ``remove`` method:: +If you make subsequent calls to ``ax.plot`` then additional lines will be added +to the list. You can remove a line later by calling its ``remove`` method:: line = ax.lines[0] line.remove() @@ -301,7 +295,7 @@ class in the Matplotlib API, and the one you will be working with most # Out[159]: # # In [160]: print(fig.axes) -# [, ] +# [, ] # # Because the figure maintains the concept of the "current Axes" (see # :meth:`Figure.gca ` and @@ -596,40 +590,16 @@ class in the Matplotlib API, and the one you will be working with most # the ticks are placed and how they are represented as strings. # # Each ``Axis`` object contains a :attr:`~matplotlib.axis.Axis.label` attribute -# (this is what :mod:`.pyplot` modifies in calls to `~.pyplot.xlabel` and -# `~.pyplot.ylabel`) as well as a list of major and minor ticks. The ticks are +# (this is what `~.Axes.set_xlabel` / `~.Axes.set_ylabel` modifies internally) +# as well as a list of major and minor ticks. The ticks are # `.axis.XTick` and `.axis.YTick` instances, which contain the actual line and # text primitives that render the ticks and ticklabels. Because the ticks are -# dynamically created as needed (e.g., when panning and zooming), you should -# access the lists of major and minor ticks through their accessor methods -# `.axis.Axis.get_major_ticks` and `.axis.Axis.get_minor_ticks`. Although -# the ticks contain all the primitives and will be covered below, ``Axis`` -# instances have accessor methods that return the tick lines, tick labels, tick -# locations etc.: - -fig, ax = plt.subplots() -axis = ax.xaxis -axis.get_ticklocs() - -# %% - -axis.get_ticklabels() - -# %% -# note there are twice as many ticklines as labels because by default there are -# tick lines at the top and bottom but only tick labels below the xaxis; -# however, this can be customized. - -axis.get_ticklines() - -# %% -# And with the above methods, you only get lists of major ticks back by -# default, but you can also ask for the minor ticks: - -axis.get_ticklabels(minor=True) -axis.get_ticklines(minor=True) - -# %% +# dynamically created and modified as needed (e.g., when panning and zooming), +# directly working on the ticks and their parts (tick lines, tick labels, grid lines) +# is discouraged. Instead, the high-level concepts tick locators, tick formatters +# and style configuration via `~.Axes.tick_params` should be used. See +# :ref:`user_axes_ticks` for details. +# # Here is a summary of some of the useful accessor methods of the ``Axis`` # (these have corresponding setters where useful, such as # :meth:`~matplotlib.axis.Axis.set_major_formatter`.) @@ -640,82 +610,16 @@ class in the Matplotlib API, and the one you will be working with most # `~.Axis.get_scale` The scale of the Axis, e.g., 'log' or 'linear' # `~.Axis.get_view_interval` The interval instance of the Axis view limits # `~.Axis.get_data_interval` The interval instance of the Axis data limits -# `~.Axis.get_gridlines` A list of grid lines for the Axis # `~.Axis.get_label` The Axis label - a `.Text` instance -# `~.Axis.get_offset_text` The Axis offset text - a `.Text` instance -# `~.Axis.get_ticklabels` A list of `.Text` instances - -# keyword minor=True|False -# `~.Axis.get_ticklines` A list of `.Line2D` instances - -# keyword minor=True|False -# `~.Axis.get_ticklocs` A list of Tick locations - -# keyword minor=True|False # `~.Axis.get_major_locator` The `.ticker.Locator` instance for major ticks # `~.Axis.get_major_formatter` The `.ticker.Formatter` instance for major # ticks # `~.Axis.get_minor_locator` The `.ticker.Locator` instance for minor ticks # `~.Axis.get_minor_formatter` The `.ticker.Formatter` instance for minor # ticks -# `~.axis.Axis.get_major_ticks` A list of `.Tick` instances for major ticks -# `~.axis.Axis.get_minor_ticks` A list of `.Tick` instances for minor ticks +# `~.Axis.get_tick_params` Styling of ticks, ticklabels and gridlines # `~.Axis.grid` Turn the grid on or off for the major or minor # ticks # ============================= ============================================== # -# Here is an example, not recommended for its beauty, which customizes -# the Axes and Tick properties. - -# plt.figure creates a matplotlib.figure.Figure instance -fig = plt.figure() -rect = fig.patch # a rectangle instance -rect.set_facecolor('lightgoldenrodyellow') - -ax1 = fig.add_axes((0.1, 0.3, 0.4, 0.4)) -rect = ax1.patch -rect.set_facecolor('lightslategray') - - -for label in ax1.xaxis.get_ticklabels(): - # label is a Text instance - label.set_color('red') - label.set_rotation(45) - label.set_fontsize(16) - -for line in ax1.yaxis.get_ticklines(): - # line is a Line2D instance - line.set_color('green') - line.set_markersize(25) - line.set_markeredgewidth(3) - -plt.show() - -# %% -# .. _tick-container: -# -# Tick containers -# --------------- -# -# The :class:`matplotlib.axis.Tick` is the final container object in our -# descent from the :class:`~matplotlib.figure.Figure` to the -# :class:`~matplotlib.axes.Axes` to the :class:`~matplotlib.axis.Axis` -# to the :class:`~matplotlib.axis.Tick`. The ``Tick`` contains the tick -# and grid line instances, as well as the label instances for the upper -# and lower ticks. Each of these is accessible directly as an attribute -# of the ``Tick``. -# -# ============== ========================================================== -# Tick attribute Description -# ============== ========================================================== -# tick1line A `.Line2D` instance -# tick2line A `.Line2D` instance -# gridline A `.Line2D` instance -# label1 A `.Text` instance -# label2 A `.Text` instance -# ============== ========================================================== -# -# Here is an example which sets the formatter for the right side ticks with -# dollar signs and colors them green on the right side of the yaxis. -# -# -# .. include:: ../gallery/ticks/dollar_ticks.rst -# :start-after: .. redirect-from:: /gallery/pyplots/dollar_ticks -# :end-before: .. admonition:: References +# The full Axis API can be found at :doc:`/api/axis_api`. diff --git a/galleries/users_explain/axes/autoscale.py b/galleries/users_explain/axes/autoscale.py index ea0c2d24c55a..22cdd1f8dc96 100644 --- a/galleries/users_explain/axes/autoscale.py +++ b/galleries/users_explain/axes/autoscale.py @@ -62,10 +62,13 @@ ax.margins(y=-0.2) # %% +# +# .. _autoscale_sticky_edges: +# # Sticky edges # ------------ # There are plot elements (`.Artist`\s) that are usually used without margins. -# For example false-color images (e.g. created with `.Axes.imshow`) are not +# For example, false-color images (e.g. created with `.Axes.imshow`) are not # considered in the margins calculation. # @@ -166,3 +169,152 @@ ax.autoscale(enable=None, axis="x", tight=True) print(ax.margins()) + +# %% +# Technical background +# -------------------- +# +# This section explains the internal pipeline that runs when autoscaling +# computes axis limits from data. Understanding the mechanics helps when +# you encounter surprising behaviour or need to update limits manually. +# +# Data limits and view limits +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Matplotlib maintains two sets of limits: +# +# - **Data limits** (`.Axes.dataLim`): the tight bounding box of the raw data. +# - **View limits** (`.Axes.viewLim`): the displayed axis limits. By default, +# computed from the data limits through the autoscaling mechanism outlined +# below, but they can be set independently. View limits can alternatively +# be set explicitly through `~.axes.Axes.set_xlim` / `~.axes.Axes.set_ylim`, +# which also disables autoscaling so that the set limits remain fixed. +# +# The following shows the input and output of this process — ``dataLim`` holds +# the raw data bounds, ``viewLim`` the final displayed axis limits. + + +fig, ax = plt.subplots() +x = np.linspace(-6, 6, 201) +y = np.sin(x) +ax.plot(x, y) +print(f"dataLim x: ({ax.dataLim.x0:.3f}, {ax.dataLim.x1:.3f})") +print(f"dataLim y: ({ax.dataLim.y0:.3f}, {ax.dataLim.y1:.3f})") +print(f"viewLim x: ({ax.viewLim.x0:.3f}, {ax.viewLim.x1:.3f})") +print(f"viewLim y: ({ax.viewLim.y0:.3f}, {ax.viewLim.y1:.3f})") + +# %% +# The x data range is [-6, 6] and the default 5% margin adds roughly 0.6 on +# each side, widening the view to about [-6.6, 6.6]. The same applies to the +# y axis. +# +# Update logic +# ~~~~~~~~~~~~ +# +# Data and view limit updates are handled as separate stages. +# +# **Data limits**: When an artist is added to an Axes through one of the +# plotting methods, the data limits are updated through `.Axes.update_datalim` +# to include the new data. This only ever increases the data limits. It is +# also possible to update `.Axes.dataLim` manually, but this is not common. +# Removal of an artist or change of its data does not trigger any update of +# the data limits, so they can become out of date. In such cases, it is +# necessary to explicitly recompute the data limit through `.Axes.relim`. +# +# **View limits**: When autoscaling is enabled, the view limits are +# automatically computed from the data limit. This update is lazy and only +# triggered when the view limits are queried or drawn, so that they don't have +# to be recomputed for every added artist. This is transparent to the user. +# Explicit changes of the data limits through `.Axes.dataLim` or `.Axes.relim` +# do not trigger an update of the view limits, so they can also become out of +# date. In such cases, it is necessary to explicitly recompute the view limits +# through `.Axes.autoscale_view`. +# +# View limit calculation +# ~~~~~~~~~~~~~~~~~~~~~~ +# +# Given the data limits, the view limits are derived through these steps: +# +# - scale domain clamping +# - margin expansion +# - sticky edge clamping +# - optional limit rounding +# +# Scale domain clamping +# ~~~~~~~~~~~~~~~~~~~~~ +# +# Before margins are applied, the data limits are clipped to the valid domain +# of the axis scale. This matters for scales like log (positive values only) +# and logit (values strictly between 0 and 1): if a bound lies outside the +# domain, it is replaced with a value at the domain boundary. +# +# For this purpose, `.Axes.dataLim` tracks not just the ordinary min/max of +# the data but also ``minpos`` — the smallest strictly positive value seen. +# A log-scale lower bound of zero or less is replaced with ``minpos`` rather +# than the actual minimum, because only positive values can be displayed. +# +# For a logit scale, the upper bound is approximated as ``1 - minpos``, since +# the largest data value below 1 is not tracked separately. This means the +# autoscaled upper limit may include slightly more headroom than necessary +# when the data maximum is well below 1. +# +# Margin expansion +# ~~~~~~~~~~~~~~~~ +# +# The first step is to apply the margins, i.e. widen the view limits beyond the +# data limits so that data is not at the very edge of the plot. Margins are +# specified as a fraction of the data span in screen coordinates so that +# the data-free border area always has the same visual size, irrespective of +# data ranges or axis scales. The margin is applied symmetrically to both sides +# of the data limits, so the view is expanded equally in both directions. +# +# This is illustrated in the following example, where the data limits and +# axis scales are different, but the visual margin is the same in both cases. + +fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(9, 4)) +fig.suptitle("Margins are visually constant, " + "even with different data limits and axis scales") + +ax1.plot([0, 10], [0, 1]) +ax1.margins(0.2) + +x = np.linspace(1, 20) +ax2.semilogy(x, np.exp(x)) +ax2.margins(0.2) + +# %% +# Sticky edges clamping +# ~~~~~~~~~~~~~~~~~~~~~ +# +# Sticky edges are axis values at which margin expansion is clamped. After +# computing the margin-expanded limits, if an expanded limit would extend +# beyond a sticky edge, it is pulled back to that edge instead. +# +# Artists register sticky edges to prevent blank margins at natural data +# boundaries. `~.Axes.imshow`, for example, registers sticky edges at its +# four pixel boundaries, which is why images fill the Axes by default without +# any surrounding margin (as shown in the :ref:`autoscale_sticky_edges` +# section above). Sticky edges only suppress *outward expansion past the data +# boundary* — they never shrink limits into the data, and negative margins +# are not affected. Setting ``Axes.use_sticky_edges = False`` disables sticky +# edge clamping on that Axes. +# +# Limit rounding +# ~~~~~~~~~~~~~~ +# +# As a final step, the view limits can optionally be expanded outward to the +# nearest "nice" tick position, so that the axis edges coincide with tick +# marks. This is disabled by default, but can be turned on with the +# "round_numbers" mode of :rc:`axes.autolimit_mode`: +# +# - ``'data'`` (default): keep the limits at the margin-expanded values. +# - ``'round_numbers'``: expand the limits outward to the nearest "nice" tick +# position, so the axis edges coincide with tick marks. + +fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 4)) +ax1.plot([0.3, 4.7], [0.3, 4.7]) +ax1.set_title("autolimit_mode='data' (default)") +with plt.rc_context({'axes.autolimit_mode': 'round_numbers'}): + ax2.plot([0.3, 4.7], [0.3, 4.7]) + ax2.set_title("autolimit_mode='round_numbers'") + ax2.autoscale_view() # force autoscale while round_numbers is active diff --git a/lib/matplotlib/_mathtext.py b/lib/matplotlib/_mathtext.py index 17dc1b8fb462..9f23e5e3ab08 100644 --- a/lib/matplotlib/_mathtext.py +++ b/lib/matplotlib/_mathtext.py @@ -1010,7 +1010,7 @@ class FontConstantsBase: class ComputerModernFontConstants(FontConstantsBase): # Previously, the x-height of Computer Modern was obtained from the font - # table. However, that x-height was greater than the the actual (rendered) + # table. However, that x-height was greater than the actual (rendered) # x-height by a factor of 1.771484375 (at font size 12, DPI 100 and hinting # type 32). Now that we're using the rendered x-height, some font constants # have been increased by the same factor to compensate. diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 687bb4b48d3b..b0ec08a78e75 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -7762,8 +7762,12 @@ def stairs(self, values, edges=None, *, if edges is None: edges = np.arange(len(values) + 1) - edges, values, baseline = self._process_unit_info( - [("x", edges), ("y", values), ("y", baseline)], kwargs) + if orientation == "vertical": + edges, values, baseline = self._process_unit_info( + [("x", edges), ("y", values), ("y", baseline)], kwargs) + else: + edges, values, baseline = self._process_unit_info( + [("y", edges), ("x", values), ("x", baseline)], kwargs) patch = mpatches.StepPatch(values, edges, diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index 685a96cc7803..53471e0f0a17 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -3522,7 +3522,7 @@ def inverse(self, values): - If iterable, must be of length `n_components`. Each element can be a scalar or array-like and is mapped through the corresponding norm. - If structured array, must have `n_components` fields. Each field - is mapped through the the corresponding norm. + is mapped through the corresponding norm. """ values = self._iterable_components_in_data(values, self.n_components) diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index 69ad36fb768b..9f179e7bfe42 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -36,7 +36,7 @@ def _get_dash_pattern(style): if isinstance(style, str): style = ls_mapper.get(style, style) # un-dashed styles - if style in ['solid', 'None']: + if style in ['solid', 'None', 'none', '', ' ']: offset = 0 dashes = None # dashed styles diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index dd80da45e332..88bad6dde1aa 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -427,6 +427,8 @@ def switch_backend(newbackend: str) -> None: try: switch_backend(candidate) except ImportError: + _log.debug("Skipping backend candidate %r as loading failed.", + candidate, exc_info=True) continue else: rcParamsOrig['backend'] = candidate diff --git a/lib/matplotlib/tests/test_collections.py b/lib/matplotlib/tests/test_collections.py index 9c9b4e643014..46122b8b1e6a 100644 --- a/lib/matplotlib/tests/test_collections.py +++ b/lib/matplotlib/tests/test_collections.py @@ -704,6 +704,17 @@ def test_set_wrong_linestyle(): c.set_linestyle('fuzzy') +@pytest.mark.parametrize('ls', ['', ' ', 'none']) +def test_scatter_empty_linestyle_pdf(ls): + # Regression test: '', ' ', and 'none' are documented "draw nothing" + # linestyle aliases but were not recognized by _get_dash_pattern, causing + # savefig to PDF to crash with "zero-size array to reduction operation maximum". + plt.switch_backend('pdf') + fig, ax = plt.subplots() + ax.scatter([0, 1], [0, 1], ls=ls) + fig.savefig(io.BytesIO()) + + @mpl.style.context('default') def test_capstyle(): col = mcollections.PathCollection([]) diff --git a/pyproject.toml b/pyproject.toml index f3c38512a2c9..eef7f82fb810 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,6 +61,8 @@ requires = [ # you really need it and aren't using an sdist. "meson-python>=0.13.2,!=0.17.*", "pybind11>=2.13.2,!=2.13.3", + # setuptools_scm 10 breaks versioning in editable installs. You can remove this pin + # if you're a downstream distributor just building wheels or your equivalent. "setuptools_scm>=7,<10", ] diff --git a/subprojects/packagefiles/qhull-143.patch b/subprojects/packagefiles/qhull-143.patch index e37a0d28da91..9819f6dd7cae 100644 --- a/subprojects/packagefiles/qhull-143.patch +++ b/subprojects/packagefiles/qhull-143.patch @@ -1,11 +1,13 @@ -From cd8c281da87d38820ecc4c452bbf6fd921155915 Mon Sep 17 00:00:00 2001 +From 61c21986f4ebd1fb68b615ac89231ad1173f6b84 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 28 Mar 2024 00:54:59 -0400 -Subject: [PATCH 1/3] Annotate printf-like functions with GCC's format +Subject: [PATCH 1/4] Annotate printf-like functions with GCC's format attribute This allows checking format strings when building with `-Wformat` (or with `-Wall`). + +Signed-off-by: Elliott Sales de Andrade --- src/libqhull/libqhull.h | 13 ++++++++++--- src/libqhull_r/libqhull_r.h | 13 ++++++++++--- @@ -13,7 +15,7 @@ with `-Wall`). 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/libqhull/libqhull.h b/src/libqhull/libqhull.h -index 90c0519b..1080ec11 100644 +index 90c0519..1080ec1 100644 --- a/src/libqhull/libqhull.h +++ b/src/libqhull/libqhull.h @@ -60,6 +60,13 @@ @@ -48,7 +50,7 @@ index 90c0519b..1080ec11 100644 /***** -geom.c/geom2.c/random.c prototypes (duplicated from geom.h, random.h) ****************/ diff --git a/src/libqhull_r/libqhull_r.h b/src/libqhull_r/libqhull_r.h -index 023e0181..917f96af 100644 +index 376c1e2..b5185bc 100644 --- a/src/libqhull_r/libqhull_r.h +++ b/src/libqhull_r/libqhull_r.h @@ -48,6 +48,13 @@ @@ -83,7 +85,7 @@ index 023e0181..917f96af 100644 /***** -geom_r.c/geom2_r.c/random_r.c prototypes (duplicated from geom_r.h, random_r.h) ****************/ diff --git a/src/testqset_r/testqset_r.c b/src/testqset_r/testqset_r.c -index 671494f3..b0253e0e 100644 +index 671494f..b0253e0 100644 --- a/src/testqset_r/testqset_r.c +++ b/src/testqset_r/testqset_r.c @@ -117,7 +117,7 @@ int error_count= 0; /* Global error_count. checkSetContents(qh) keeps its own @@ -104,12 +106,16 @@ index 671494f3..b0253e0e 100644 void qh_fprintf(qhT *qh, FILE *fp, int msgcode, const char *fmt, ... ) { static int needs_cr= 0; /* True if qh_fprintf needs a CR. testqset_r is not itself reentrant */ +-- +2.54.0 + -From cc7e366259866d4cd24a312a4aaf891ff0abe85a Mon Sep 17 00:00:00 2001 +From 14f0beeffbfb2505c5b0bf4b8d1b0981025461f5 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 28 Mar 2024 01:05:06 -0400 -Subject: [PATCH 2/3] Fix arguments inconsistent with their format strings +Subject: [PATCH 2/4] Fix arguments inconsistent with their format strings +Signed-off-by: Elliott Sales de Andrade --- src/libqhull/global.c | 2 +- src/libqhull/merge.c | 11 +++++------ @@ -123,7 +129,7 @@ Subject: [PATCH 2/3] Fix arguments inconsistent with their format strings 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/libqhull/global.c b/src/libqhull/global.c -index 27babbb4..faf67f37 100644 +index 9a81001..47dc46d 100644 --- a/src/libqhull/global.c +++ b/src/libqhull/global.c @@ -2248,7 +2248,7 @@ void qh_lib_check(int qhullLibraryType, int qhTsize, int vertexTsize, int ridgeT @@ -136,7 +142,7 @@ index 27babbb4..faf67f37 100644 } if (last_errcode) { diff --git a/src/libqhull/merge.c b/src/libqhull/merge.c -index de3a0b00..89392dc6 100644 +index de3a0b0..89392dc 100644 --- a/src/libqhull/merge.c +++ b/src/libqhull/merge.c @@ -427,7 +427,7 @@ void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, coo @@ -186,7 +192,7 @@ index de3a0b00..89392dc6 100644 ridge->mergevertex= True; /* disables check for duplicate vertices in qh_checkfacet */ ridgeA->mergevertex= True; diff --git a/src/libqhull/poly2.c b/src/libqhull/poly2.c -index 0bdfa6d6..9077b9c3 100644 +index 4a207b8..b30a2b6 100644 --- a/src/libqhull/poly2.c +++ b/src/libqhull/poly2.c @@ -1144,7 +1144,7 @@ boolT qh_checklists(facetT *facetlist) { @@ -209,7 +215,7 @@ index 0bdfa6d6..9077b9c3 100644 facet->flipped= False; facet->toporient ^= (unsigned char)True; diff --git a/src/libqhull_r/global_r.c b/src/libqhull_r/global_r.c -index 3a0b9c62..c681a715 100644 +index 04b9b4d..01dfe8e 100644 --- a/src/libqhull_r/global_r.c +++ b/src/libqhull_r/global_r.c @@ -2201,7 +2201,7 @@ void qh_lib_check(int qhullLibraryType, int qhTsize, int vertexTsize, int ridgeT @@ -222,7 +228,7 @@ index 3a0b9c62..c681a715 100644 } if (last_errcode) { diff --git a/src/libqhull_r/mem_r.c b/src/libqhull_r/mem_r.c -index 7d5509eb..d811f733 100644 +index 7d5509e..d811f73 100644 --- a/src/libqhull_r/mem_r.c +++ b/src/libqhull_r/mem_r.c @@ -186,7 +186,7 @@ void qh_memcheck(qhT *qh) { @@ -244,7 +250,7 @@ index 7d5509eb..d811f733 100644 /*-mergevertex= True; /* disables check for duplicate vertices in qh_checkfacet */ ridgeA->mergevertex= True; diff --git a/src/libqhull_r/poly2_r.c b/src/libqhull_r/poly2_r.c -index 01758340..4d9a0c51 100644 +index 1ab5244..a97254e 100644 --- a/src/libqhull_r/poly2_r.c +++ b/src/libqhull_r/poly2_r.c @@ -1145,7 +1145,7 @@ boolT qh_checklists(qhT *qh, facetT *facetlist) { @@ -317,7 +323,7 @@ index 01758340..4d9a0c51 100644 facet->flipped= False; facet->toporient ^= (unsigned char)True; diff --git a/src/libqhullcpp/Qhull.cpp b/src/libqhullcpp/Qhull.cpp -index d5c75e92..3123e8ae 100644 +index d5c75e9..3123e8a 100644 --- a/src/libqhullcpp/Qhull.cpp +++ b/src/libqhullcpp/Qhull.cpp @@ -357,7 +357,7 @@ initializeFeasiblePoint(int hulldim) @@ -330,7 +336,7 @@ index d5c75e92..3123e8ae 100644 } qh_qh->feasible_point= static_cast(qh_malloc(static_cast(hulldim) * sizeof(coordT))); diff --git a/src/testqset_r/testqset_r.c b/src/testqset_r/testqset_r.c -index b0253e0e..5ea87394 100644 +index b0253e0..5ea8739 100644 --- a/src/testqset_r/testqset_r.c +++ b/src/testqset_r/testqset_r.c @@ -532,7 +532,7 @@ void testSetequalInEtc(qhT *qh, int numInts, int *intarray, int checkEvery) @@ -380,19 +386,23 @@ index b0253e0e..5ea87394 100644 error_count++; } } +-- +2.54.0 -From f7c3bbdfd23c034f5af66fa1f067691aac3378d8 Mon Sep 17 00:00:00 2001 + +From 2dda51b2f2ec394462cb95ce37b5afc9701c8446 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 28 Mar 2024 05:11:33 -0400 -Subject: [PATCH 3/3] Don't pass user-defined input as format string +Subject: [PATCH 3/4] Don't pass user-defined input as format string +Signed-off-by: Elliott Sales de Andrade --- src/libqhull/io.c | 2 +- src/libqhull_r/io_r.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libqhull/io.c b/src/libqhull/io.c -index beed156a..7b7f4546 100644 +index beed156..7b7f454 100644 --- a/src/libqhull/io.c +++ b/src/libqhull/io.c @@ -1618,7 +1618,7 @@ void qh_printcenter(FILE *fp, qh_PRINT format, const char *string, facetT *facet @@ -405,7 +415,7 @@ index beed156a..7b7f4546 100644 num= qh hull_dim-1; if (!facet->normal || !facet->upperdelaunay || !qh ATinfinity) { diff --git a/src/libqhull_r/io_r.c b/src/libqhull_r/io_r.c -index a80a5b14..389b1aa6 100644 +index a80a5b1..389b1aa 100644 --- a/src/libqhull_r/io_r.c +++ b/src/libqhull_r/io_r.c @@ -1618,7 +1618,7 @@ void qh_printcenter(qhT *qh, FILE *fp, qh_PRINT format, const char *string, face @@ -417,3 +427,48 @@ index a80a5b14..389b1aa6 100644 if (qh->CENTERtype == qh_ASvoronoi) { num= qh->hull_dim-1; if (!facet->normal || !facet->upperdelaunay || !qh->ATinfinity) { +-- +2.54.0 + + +From b6d5a184cd64d160a50d799ad8b179efeffed121 Mon Sep 17 00:00:00 2001 +From: Brad Barber +Date: Sun, 7 Sep 2025 14:52:49 -0400 +Subject: [PATCH 4/4] poly2.c, poly2_r.c: fixed missing + 'getid_(previousvertex)' for #143 + +Signed-off-by: Elliott Sales de Andrade +--- + src/libqhull/poly2.c | 2 +- + src/libqhull_r/poly2_r.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/libqhull/poly2.c b/src/libqhull/poly2.c +index b30a2b6..f70180e 100644 +--- a/src/libqhull/poly2.c ++++ b/src/libqhull/poly2.c +@@ -1144,7 +1144,7 @@ boolT qh_checklists(facetT *facetlist) { + vertex->visitid= qh vertex_visit; + if (vertex->previous != previousvertex) { + qh_fprintf(qh ferr, 6427, "qhull internal error (qh_checklists): expecting v%d.previous == v%d. Got v%d\n", +- vertex->id, previousvertex->id, getid_(vertex->previous)); ++ vertex->id, getid_(previousvertex), getid_(vertex->previous)); + waserror= True; + errorvertex= vertex; + } +diff --git a/src/libqhull_r/poly2_r.c b/src/libqhull_r/poly2_r.c +index a97254e..44110db 100644 +--- a/src/libqhull_r/poly2_r.c ++++ b/src/libqhull_r/poly2_r.c +@@ -1145,7 +1145,7 @@ boolT qh_checklists(qhT *qh, facetT *facetlist) { + vertex->visitid= qh->vertex_visit; + if (vertex->previous != previousvertex) { + qh_fprintf(qh, qh->ferr, 6427, "qhull internal error (qh_checklists): expecting v%d.previous == v%d. Got v%d\n", +- vertex->id, previousvertex->id, getid_(vertex->previous)); ++ vertex->id, getid_(previousvertex), getid_(vertex->previous)); + waserror= True; + errorvertex= vertex; + } +-- +2.54.0 +