Skip to content

Merge branch v3.7.x into v3.8.x #26761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions doc/_static/zenodo_cache/8336761.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
# All configuration values have a default value; values that are commented out
# serve to show the default value.

from datetime import datetime, timezone
import logging
import os
from pathlib import Path
import shutil
import subprocess
import sys
import time
from urllib.parse import urlsplit, urlunsplit
import warnings

Expand All @@ -25,9 +27,6 @@

import matplotlib

from datetime import timezone
from datetime import datetime
import time

# debug that building expected version
print(f"Building Documentation for Matplotlib: {matplotlib.__version__}")
Expand Down
31 changes: 26 additions & 5 deletions doc/devel/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ case :file:`lib/matplotlib/tests/baseline_images/test_lines`). Put this new
file under source code revision control (with ``git add``). When rerunning
the tests, they should now pass.

It is preferred that new tests use ``style='mpl20'`` as this leads to smaller
figures and reflects the newer look of default Matplotlib plots. Also, if the
texts (labels, tick labels, etc) are not really part of what is tested, use
``remove_text=True`` as this will lead to smaller figures and reduce possible
issues with font mismatch on different platforms.

Baseline images take a lot of space in the Matplotlib repository.
An alternative approach for image comparison tests is to use the
`~matplotlib.testing.decorators.check_figures_equal` decorator, which should be
Expand All @@ -130,11 +136,26 @@ images on the figures using two different methods (the tested method and the
baseline method). The decorator will arrange for setting up the figures and
then collect the drawn results and compare them.

It is preferred that new tests use ``style='mpl20'`` as this leads to smaller
figures and reflects the newer look of default Matplotlib plots. Also, if the
texts (labels, tick labels, etc) are not really part of what is tested, use
``remove_text=True`` as this will lead to smaller figures and reduce possible
issues with font mismatch on different platforms.
For example, this test compares two different methods to draw the same
circle: plotting a circle using a `matplotlib.patches.Circle` patch
vs plotting the circle using the parametric equation of a circle ::

from matplotlib.testing.decorators import check_figures_equal
import matplotib.patches as mpatches
import matplotlib.pyplot as plt
import numpy as np

@check_figures_equal(extensions=['png'], tol=100)
def test_parametric_circle_plot(fig_test, fig_ref):
red_circle_ref = mpatches.Circle((0, 0), 0.2, color='r', clip_on=False)
fig_ref.add_artist(red_circle_ref)
theta = np.linspace(0, 2 * np.pi, 150)
radius = 0.4
fig_test.plot(radius * np.cos(theta), radius * np.sin(theta), color='r')

Both comparison decorators have a tolerance argument ``tol`` that is used to specify the
tolerance for difference in color value between the two images, where 255 is the maximal
difference. The test fails if the average pixel difference is greater than this value.

See the documentation of `~matplotlib.testing.decorators.image_comparison` and
`~matplotlib.testing.decorators.check_figures_equal` for additional information
Expand Down
101 changes: 101 additions & 0 deletions doc/users/prev_whats_new/github_stats_3.7.3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
.. _github-stats-3-7-3:

GitHub statistics for 3.7.3 (Sep 11, 2023)
==========================================

GitHub statistics for 2023/07/05 (tag: v3.7.2) - 2023/09/11

These lists are automatically generated, and may be incomplete or contain duplicates.

We closed 14 issues and merged 48 pull requests.
The full list can be seen `on GitHub <https://github.com/matplotlib/matplotlib/milestone/82?closed=1>`__

The following 17 authors contributed 130 commits.

* amiraflak
* Amirreza Aflakparast
* dependabot[bot]
* Elliott Sales de Andrade
* Greg Lucas
* hannah
* Haoying Zhang
* Jody Klymak
* Kritika Verma
* Kyle Sunden
* marbled-toast
* Mateusz Sokół
* Matthew Feickert
* Oscar Gustafsson
* Ruth Comer
* Thomas A Caswell
* Tim Hoffmann

GitHub issues and pull requests:

Pull Requests (48):

* :ghpull:`26725`: Backport PR #26719 on branch v3.7.x (Fix issue with missing attribute in Path3DCollection)
* :ghpull:`26723`: Backport PR #26721 on branch v3.7.x (Add a Python 3.12 classifier)
* :ghpull:`26719`: Fix issue with missing attribute in Path3DCollection
* :ghpull:`26721`: Add a Python 3.12 classifier
* :ghpull:`26672`: Backport cibuildwheel updates to v3.7.x
* :ghpull:`26706`: Pin NumPy below v2 for 3.7.x
* :ghpull:`26653`: Backport PR #26597 on branch v3.7.x (Squeeze post-converted values when validating limits)
* :ghpull:`26597`: Squeeze post-converted values when validating limits
* :ghpull:`26582`: MNT: Enable wheels for Python 3.12
* :ghpull:`26616`: Backport PR #26598 on branch v3.7.x (FIX: array labelcolor for Tick)
* :ghpull:`26598`: FIX: array labelcolor for Tick
* :ghpull:`26610`: Backport PR #26538 on branch v3.7.x (Resolves #26421 Added an example for fig comparison decorator)
* :ghpull:`26538`: Resolves #26421 Added an example for fig comparison decorator
* :ghpull:`26574`: Backport PR #26571 on branch v3.7.x ([Doc]: match 3D plot types with others)
* :ghpull:`26571`: [Doc]: match 3D plot types with others
* :ghpull:`26570`: Backport PR #26569 on branch v3.7.x (refactor: constant "ncols" to variables)
* :ghpull:`26569`: refactor: constant "ncols" to variables
* :ghpull:`26555`: Backport PR #26554 on branch v3.7.x (Remove NumPy abs overrides from pylab)
* :ghpull:`26552`: Backport PR #26493: Disable ````add_html_cache_busting```` on Sphinx 7.1+
* :ghpull:`26554`: Remove NumPy abs overrides from pylab
* :ghpull:`26549`: Backport PR #26545 on branch v3.7.x (Fix size inferral when using cairocffi)
* :ghpull:`26545`: Fix size inferral when using cairocffi
* :ghpull:`26544`: Backport PR #26532: Fix input check in Poly3DCollection.__init__
* :ghpull:`26532`: Fix input check in Poly3DCollection.__init__
* :ghpull:`26459`: Backport PR #26458 on branch v3.7.x (Remove soon to be deprecated nan/inf aliases)
* :ghpull:`26458`: Remove soon to be deprecated nan/inf aliases
* :ghpull:`26455`: Backport PR #26452 on branch v3.7.x (ENH: Update numpy exceptions imports)
* :ghpull:`26452`: ENH: Update numpy exceptions imports
* :ghpull:`26439`: Backport PR #26436 on branch v3.7.x (DOC: Add a warning that ticks are not persistent)
* :ghpull:`26432`: Backport PR #26431 on branch v3.7.x (MNT: Unpin pyparsing, xfail error message tests for pyparsing 3.1.0)
* :ghpull:`26436`: DOC: Add a warning that ticks are not persistent
* :ghpull:`26428`: Merge branch v3.7.2-doc into v3.7.x
* :ghpull:`26431`: MNT: Unpin pyparsing, xfail error message tests for pyparsing 3.1.0
* :ghpull:`26412`: Backport PR #26405 on branch v3.7.x (DOC: Clarify the difference between document and section references)
* :ghpull:`26390`: Backport PR #26354 on branch v3.7.x (DOC: contourf antialiased default)
* :ghpull:`26354`: DOC: contourf antialiased default
* :ghpull:`26386`: Backport PR #26370 on branch v3.7.x (Update README.txt )
* :ghpull:`26364`: Backport PR #26361 on branch v3.7.x (LIC: Update the license we bundle the colorbrewer colormap data with)
* :ghpull:`26361`: LIC: Update the license we bundle the colorbrewer colormap data with
* :ghpull:`26322`: Backport PR #26321 on branch v3.7.x (remove quote box from font_manager)
* :ghpull:`26318`: Backport PR #26317 on branch v3.7.x (update the doc string for fancyarrowpatch to link to annotate)
* :ghpull:`26317`: update the doc string for fancyarrowpatch to link to annotate
* :ghpull:`26304`: Backport PR #26300 on branch v3.7.x (FIX: do not warn when calling tight_layout multiple times)
* :ghpull:`26300`: FIX: do not warn when calling tight_layout multiple times
* :ghpull:`26301`: Backport PR #26291 on branch v3.7.x (Get correct renderer for axes_grid1 inset axes with bbox_inches=tight)
* :ghpull:`26298`: Backport PR #26195 on branch v3.7.x ([Doc] link style sheets reference to customization tutorial)
* :ghpull:`26291`: Get correct renderer for axes_grid1 inset axes with bbox_inches=tight
* :ghpull:`26267`: Backport PR #26266 on branch v3.7.x (DOC: Use consistent font for anatomy example)

Issues (14):

* :ghissue:`26732`: [ENH]: Parser errors should mention that commands do not exist
* :ghissue:`26497`: [Bug]: AttributeError: 'Path3DCollection' object has no attribute '_offset_zordered' (possible regression)
* :ghissue:`26588`: [Bug]: Tick class instantiation returns an error when labelcolor is a tuple
* :ghissue:`26421`: [Doc]: demo testing comparison decorator
* :ghissue:`26486`: [Doc]: match 3D plot types listings titles to other titles
* :ghissue:`26560`: [Doc]: ncols parameter hard-coded
* :ghissue:`26553`: [TST] Upcoming dependency test failures
* :ghissue:`26523`: [Bug]: backend_cairo set_context() is broken for cairocffi
* :ghissue:`26420`: Typo in Poly3DCollection constructor
* :ghissue:`26152`: [Bug]: Pyparsing 3.1 breaks tests
* :ghissue:`26336`: [Doc]: GPL compatibility
* :ghissue:`19721`: head size of FancyArrowPatch is "invisibly small" by default
* :ghissue:`26290`: [Bug]: calling fig.tight_layout multiple times
* :ghissue:`26287`: [Bug]: Error while creating inset axes using ``mpl_toolkits.axes_grid1.inset_locator.inset_axes``
3 changes: 3 additions & 0 deletions doc/users/project/citing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ By version
.. START OF AUTOGENERATED


v3.7.3
.. image:: ../../_static/zenodo_cache/8336761.svg
:target: https://doi.org/10.5281/zenodo.8336761
v3.7.2
.. image:: ../../_static/zenodo_cache/8118151.svg
:target: https://doi.org/10.5281/zenodo.8118151
Expand Down
10 changes: 9 additions & 1 deletion doc/users/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,22 @@ Release notes
.. include:: release_notes_next.rst


Version 3.8
===========
.. toctree::
:maxdepth: 1

github_stats.rst

Version 3.7
===========
.. toctree::
:maxdepth: 1

prev_whats_new/whats_new_3.7.0.rst
../api/prev_api_changes/api_changes_3.7.0.rst
github_stats.rst
prev_whats_new/github_stats_3.7.3.rst
prev_whats_new/github_stats_3.7.2.rst
prev_whats_new/github_stats_3.7.1.rst
prev_whats_new/github_stats_3.7.0.rst

Expand Down
4 changes: 2 additions & 2 deletions galleries/examples/color/named_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ def plot_colortable(colors, *, ncols=4, sort_colors=True):
n = len(names)
nrows = math.ceil(n / ncols)

width = cell_width * 4 + 2 * margin
width = cell_width * ncols + 2 * margin
height = cell_height * nrows + 2 * margin
dpi = 72

fig, ax = plt.subplots(figsize=(width / dpi, height / dpi), dpi=dpi)
fig.subplots_adjust(margin/width, margin/height,
(width-margin)/width, (height-margin)/height)
ax.set_xlim(0, cell_width * 4)
ax.set_xlim(0, cell_width * ncols)
ax.set_ylim(cell_height * (nrows-0.5), -cell_height/2.)
ax.yaxis.set_visible(False)
ax.xaxis.set_visible(False)
Expand Down
6 changes: 3 additions & 3 deletions galleries/plot_types/3D/scatter3d_simple.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==============
3D scatterplot
==============
===================
scatter(xs, ys, zs)
===================

See `~mpl_toolkits.mplot3d.axes3d.Axes3D.scatter`.
"""
Expand Down
2 changes: 1 addition & 1 deletion galleries/plot_types/3D/surface3d_simple.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
=====================
3D surface
plot_surface(X, Y, Z)
=====================

See `~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_surface`.
Expand Down
6 changes: 3 additions & 3 deletions galleries/plot_types/3D/trisurf3d_simple.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
======================
Triangular 3D surfaces
======================
=====================
plot_trisurf(x, y, z)
=====================

See `~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf`.
"""
Expand Down
6 changes: 3 additions & 3 deletions galleries/plot_types/3D/voxels_simple.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==========================
3D voxel / volumetric plot
==========================
=========================
voxels([x, y, z], filled)
=========================

See `~mpl_toolkits.mplot3d.axes3d.Axes3D.voxels`.
"""
Expand Down
6 changes: 3 additions & 3 deletions galleries/plot_types/3D/wire3d_simple.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
=================
3D wireframe plot
=================
=======================
plot_wireframe(X, Y, Z)
=======================

See `~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_wireframe`.
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def make_release_tree(self, base_dir, files):
"cycler>=0.10",
"fonttools>=4.22.0",
"kiwisolver>=1.0.1",
"numpy>=1.21",
"numpy>=1.21,<2",
"packaging>=20.0",
"pillow>=6.2.0",
"pyparsing>=2.3.1",
Expand Down
1 change: 1 addition & 0 deletions tools/cache_zenodo_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def _get_xdg_cache_dir():

if __name__ == "__main__":
data = {
"v3.7.3": "8336761",
"v3.7.2": "8118151",
"v3.7.1": "7697899",
"v3.7.0": "7637593",
Expand Down