From 5ea9a7f6b23ffa7a0f9a37e8422feddefa75d0db Mon Sep 17 00:00:00 2001 From: hannah Date: Sun, 7 Jul 2024 06:10:23 -0400 Subject: [PATCH 01/37] Backport PR #28517: DOC: better cross referencing for animations --- doc/api/animation_api.rst | 3 +++ galleries/users_explain/animations/animations.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/api/animation_api.rst b/doc/api/animation_api.rst index df39b5942199..1233b482165d 100644 --- a/doc/api/animation_api.rst +++ b/doc/api/animation_api.rst @@ -18,6 +18,9 @@ Animation The easiest way to make a live animation in Matplotlib is to use one of the `Animation` classes. +.. seealso:: + - :ref:`animations` + .. inheritance-diagram:: matplotlib.animation.FuncAnimation matplotlib.animation.ArtistAnimation :parts: 1 diff --git a/galleries/users_explain/animations/animations.py b/galleries/users_explain/animations/animations.py index 0391d9bc030a..2711663196f2 100644 --- a/galleries/users_explain/animations/animations.py +++ b/galleries/users_explain/animations/animations.py @@ -11,7 +11,7 @@ generate animations using the `~matplotlib.animation` module. An animation is a sequence of frames where each frame corresponds to a plot on a `~matplotlib.figure.Figure`. This tutorial covers a general guideline on -how to create such animations and the different options available. +how to create such animations and the different options available. More information is available in the API description: `~matplotlib.animation` """ import matplotlib.pyplot as plt From af6cc664bcdff66b1f1c3d4afdc93832681253ef Mon Sep 17 00:00:00 2001 From: hannah Date: Sun, 7 Jul 2024 06:10:23 -0400 Subject: [PATCH 02/37] Backport PR #28517: DOC: better cross referencing for animations --- doc/api/animation_api.rst | 3 +++ galleries/users_explain/animations/animations.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/api/animation_api.rst b/doc/api/animation_api.rst index df39b5942199..1233b482165d 100644 --- a/doc/api/animation_api.rst +++ b/doc/api/animation_api.rst @@ -18,6 +18,9 @@ Animation The easiest way to make a live animation in Matplotlib is to use one of the `Animation` classes. +.. seealso:: + - :ref:`animations` + .. inheritance-diagram:: matplotlib.animation.FuncAnimation matplotlib.animation.ArtistAnimation :parts: 1 diff --git a/galleries/users_explain/animations/animations.py b/galleries/users_explain/animations/animations.py index 0391d9bc030a..2711663196f2 100644 --- a/galleries/users_explain/animations/animations.py +++ b/galleries/users_explain/animations/animations.py @@ -11,7 +11,7 @@ generate animations using the `~matplotlib.animation` module. An animation is a sequence of frames where each frame corresponds to a plot on a `~matplotlib.figure.Figure`. This tutorial covers a general guideline on -how to create such animations and the different options available. +how to create such animations and the different options available. More information is available in the API description: `~matplotlib.animation` """ import matplotlib.pyplot as plt From b7afb01dab684ddb8d6631ca2a0698f7f54bbfe0 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Mon, 8 Jul 2024 08:44:59 -0500 Subject: [PATCH 03/37] Backport PR #28523: Fix value error when set widget size to zero while using FiCureCanvasQT --- lib/matplotlib/backends/backend_qt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_qt.py b/lib/matplotlib/backends/backend_qt.py index a93b37799971..6603883075d4 100644 --- a/lib/matplotlib/backends/backend_qt.py +++ b/lib/matplotlib/backends/backend_qt.py @@ -492,7 +492,7 @@ def _draw_idle(self): if not self._draw_pending: return self._draw_pending = False - if self.height() < 0 or self.width() < 0: + if self.height() <= 0 or self.width() <= 0: return try: self.draw() From 3d1b29b738f5ffb2b83f87ca03f30acd308e30c1 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 12 Jul 2024 14:14:47 -0400 Subject: [PATCH 04/37] Backport PR #28541: MNT: be more careful about disk I/O failures when writing font cache --- lib/matplotlib/font_manager.py | 8 ++++---- lib/matplotlib/tests/test_font_manager.py | 24 ++++++++++++++++++++++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py index 813bee6eb623..d9560ec0cc0f 100644 --- a/lib/matplotlib/font_manager.py +++ b/lib/matplotlib/font_manager.py @@ -965,11 +965,11 @@ def json_dump(data, filename): This function temporarily locks the output file to prevent multiple processes from overwriting one another's output. """ - with cbook._lock_path(filename), open(filename, 'w') as fh: - try: + try: + with cbook._lock_path(filename), open(filename, 'w') as fh: json.dump(data, fh, cls=_JSONEncoder, indent=2) - except OSError as e: - _log.warning('Could not save font_manager cache %s', e) + except OSError as e: + _log.warning('Could not save font_manager cache %s', e) def json_load(filename): diff --git a/lib/matplotlib/tests/test_font_manager.py b/lib/matplotlib/tests/test_font_manager.py index 9563e4bf0869..776af16eeaaf 100644 --- a/lib/matplotlib/tests/test_font_manager.py +++ b/lib/matplotlib/tests/test_font_manager.py @@ -16,7 +16,7 @@ json_dump, json_load, get_font, is_opentype_cff_font, MSUserFontDirectories, _get_fontconfig_fonts, ttfFontProperty) from matplotlib import cbook, ft2font, pyplot as plt, rc_context, figure as mfigure -from matplotlib.testing import subprocess_run_helper +from matplotlib.testing import subprocess_run_helper, subprocess_run_for_testing has_fclist = shutil.which('fc-list') is not None @@ -280,6 +280,28 @@ def test_fontcache_thread_safe(): subprocess_run_helper(_test_threading, timeout=10) +def test_lockfilefailure(tmp_path): + # The logic here: + # 1. get a temp directory from pytest + # 2. import matplotlib which makes sure it exists + # 3. get the cache dir (where we check it is writable) + # 4. make it not writable + # 5. try to write into it via font manager + proc = subprocess_run_for_testing( + [ + sys.executable, + "-c", + "import matplotlib;" + "import os;" + "p = matplotlib.get_cachedir();" + "os.chmod(p, 0o555);" + "import matplotlib.font_manager;" + ], + env={**os.environ, 'MPLCONFIGDIR': str(tmp_path)}, + check=True + ) + + def test_fontentry_dataclass(): fontent = FontEntry(name='font-name') From 8ede65d3a5a0b9f8047f175b632201cb113a151a Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Sat, 13 Jul 2024 12:06:20 -0500 Subject: [PATCH 05/37] Backport PR #28526: Bump pypa/cibuildwheel from 2.19.1 to 2.19.2 in the actions group --- .github/workflows/cibuildwheel.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index a4c0c0781813..050ff16cfbbd 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -135,7 +135,7 @@ jobs: path: dist/ - name: Build wheels for CPython 3.12 - uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1 + uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -143,7 +143,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for CPython 3.11 - uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1 + uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -151,7 +151,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for CPython 3.10 - uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1 + uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -159,7 +159,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for CPython 3.9 - uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1 + uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -167,7 +167,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for PyPy - uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1 + uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: From fadfe844470759dfb77f3589c9b2e9d57c0587b8 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sat, 13 Jul 2024 11:20:24 -0700 Subject: [PATCH 06/37] Backport PR #28534: [BLD] Fix WSL build warning --- src/_image_resample.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_image_resample.h b/src/_image_resample.h index 745fe9f10cd7..a6404092ea2d 100644 --- a/src/_image_resample.h +++ b/src/_image_resample.h @@ -500,7 +500,7 @@ typedef enum { // T is rgba if and only if it has an T::r field. template struct is_grayscale : std::true_type {}; -template struct is_grayscale : std::false_type {}; +template struct is_grayscale> : std::false_type {}; template From 73df1322432503d6c4e9f6a6d70ec9d936f91a46 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 14 Jul 2024 08:52:46 +0200 Subject: [PATCH 07/37] Backport PR #28571: DOC: Add version directive to hatch parameter in stackplot --- lib/matplotlib/stackplot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/matplotlib/stackplot.py b/lib/matplotlib/stackplot.py index dd579bcd5877..43da57c25da5 100644 --- a/lib/matplotlib/stackplot.py +++ b/lib/matplotlib/stackplot.py @@ -64,6 +64,9 @@ def stackplot(axes, x, *args, of provided *y*, in which case the styles will repeat from the beginning. + .. versionadded:: 3.9 + Support for list input + data : indexable object, optional DATA_PARAMETER_PLACEHOLDER From 26ca2f6013b706cc0d54f02c2d580255c1880c6d Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Wed, 17 Jul 2024 07:15:46 -0700 Subject: [PATCH 08/37] Backport PR #28582: FIX: make sticky edge tolerance relative to data range --- lib/matplotlib/axes/_base.py | 10 ++-------- .../test_axes/sticky_tolerance_cf.png | Bin 0 -> 6222 bytes lib/matplotlib/tests/test_axes.py | 10 ++++++++++ 3 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 lib/matplotlib/tests/baseline_images/test_axes/sticky_tolerance_cf.png diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index f83999436cbb..17feef5b2105 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -2962,22 +2962,16 @@ def handle_single_axis( # Prevent margin addition from crossing a sticky value. A small # tolerance must be added due to floating point issues with - # streamplot; it is defined relative to x0, x1, x1-x0 but has + # streamplot; it is defined relative to x1-x0 but has # no absolute term (e.g. "+1e-8") to avoid issues when working with # datasets where all values are tiny (less than 1e-8). - tol = 1e-5 * max(abs(x0), abs(x1), abs(x1 - x0)) + tol = 1e-5 * abs(x1 - x0) # Index of largest element < x0 + tol, if any. i0 = stickies.searchsorted(x0 + tol) - 1 x0bound = stickies[i0] if i0 != -1 else None - # Ensure the boundary acts only if the sticky is the extreme value - if x0bound is not None and x0bound > x0: - x0bound = None # Index of smallest element > x1 - tol, if any. i1 = stickies.searchsorted(x1 - tol) x1bound = stickies[i1] if i1 != len(stickies) else None - # Ensure the boundary acts only if the sticky is the extreme value - if x1bound is not None and x1bound < x1: - x1bound = None # Add the margin in figure space and then transform back, to handle # non-linear scales. diff --git a/lib/matplotlib/tests/baseline_images/test_axes/sticky_tolerance_cf.png b/lib/matplotlib/tests/baseline_images/test_axes/sticky_tolerance_cf.png new file mode 100644 index 0000000000000000000000000000000000000000..a2e185c2769d6de5ae19ee2154fc6097a9173a32 GIT binary patch literal 6222 zcmeHLdpuP6-~XP|;LxODwoo=>y4Xq>tY~9qM3kc1h$5GyRW=h9B^;OCD3u-xPgAz1 z%eJZbQ5)9%vdu1Cw%XOjG8NgPTuN@?_c`BVe$VgOzn;IJ*Yk%lobUOb@Avb0-@Yex zjl0Vftr=Pfp(!g|oz@{l(g+bsN*(_5`ESi_@N2_vXYbu#hKKBq3XIr_RtN5ug@x}9 z3k?$N-5L=Y8otxYOk`nZVHUh~ueF6};WoP<+d$hbi!H5f%z`Z~EUhgTi)>5D_3vayTkd07u>wVbx!7Fy<{hCDuENFUB)phn`EQ${P=%09$6Tks7K4Uymj?m zlX9Kc?Y;K=chNCnnTt$zMLufmdhc*I`eMxGPJhqwyDr;97aw~5+G%gakp1U(l5U3- z%}2=k#ib9E5V9~MD0EN%|3Ch%2H7{ai>u`CWBrFKDu+iqa^pA0jlIjw%0JM)u)R7- zV_Gg373bX!`O;yiEu-(w7u}iX&e`0wAc~WUii#rk@838gLNp=I&CQBxjlKC{%lh7c zqQ_y|#dW@ACFojHXJ6Yd8GR$;ACI;F^~R)kfDBdo1 zeBdzp{#{>I{D-2x=k{ndkf&=Y=2Tt3|2`ssK~y-Db%hWv2Ns!2n=F8<}iH}sP? zRE$3e-#ogJTeEO{f3L}g%IQgI&giJpQvDl2**taQ(ln{D;;d$sj*ptLiF)8E&-7({ z`b3IU;rH`*yyOjaf`bBNBH=m)PfJ#$W}l_1QhO@|PC>jMebh?K3EQ<^QiYvPt&K?G zz)^Bjq$yVtd3HLH8%SA*JjGZyso?ek#n&9=Dww^)iTkupU_cb3Af7N!;N)KCt4mLQ z;lw?zpZv9#l%sT14GK8L37AwTaPpF-$WxvgqnWBf)$M%xNTHVFomBlFQ>(Y?(kW6` zZ#Clx;bv_@G2J96rA`o5q;)43&DlCFS2*oAUGN-zsbw~IjwlY(fp>?M{c@ge)Fq^guvYfA)ZD2OaF;y+}EnL~Bnk_nt zO!v`A;z1E2gkwQu`r`=Ux30|M0^E^h3_I+{2K@s=ugu-%8$FE8{*@y*EL1lx)FQ)m zY15PV;h#C9`zTM)CQmu*N2XuI4Y@aqa4o{yzNb#OzPpl`&QB`vC3)9$lG5K*2uu&7 zW@+odh3=8OR)1gL^#^8X-%izs4w)vQ=IY0feeCS*ua4@cH7=m+MAW-}71V<#E4SZR zkQcwN(y)B=(({b9N&3mIl%fM)h7K=!pwi5(Uw#28kC^q{To2p-AzF zqonW^sE?I8VQYzN2KCZjfxLn+3*ZSra7`Y@mWjGSB9iOlQEg@BiVBX>iRImK&vZY{ zDg)K9lF5Xvm3tlF9%hc@6SiMM4^kO|m#si%w0^RDKn)0>1muqO)$+&1XKQvr&)HxT=3WbE~To}S*c+z>IY5#Th-4ZT%%bzPC4IrB$cS~V^h zl*jBY<6=LI@*cyzVPdapCA}%Wo>t2p57pe*vJ`d$A zQVn|w#8={F{xu>V4H^1#(S^ zfB1D|T-@f7;{n?o0nV;F*k$a9TB)BY=lL({S;&B&e|7FBz(w zT#m^3STEcJC}9&;lk^f@x{9$K;QV5e_vkPzJ}BLeM^}|&ZdrLULcmy*;vrQ^>JINV}`|;Hf3%V_;!l=|HVM0Em`J!(+jA}-maDVgqua}15nYhnSo?uPCg#=9A$)CsObIxxkH z4;Pio4mQMOlP-{rM%;%2@KCFl zu~OJYvpcFG*_rG>0WdIYY~UM~ZVo}MF2F$b(v*Ca#&pMZ2N-%Ig9cY1Euea)txnN; zpd!u^jCmL19j4C(QZm*MDGa&B5ft#59j2G)&{ZvX3yleg^Y%8@z>6ypnS?bkX9i(Q zzZiejuqnKJ*u1oVap|uflO8-{C+ns<0b{?}VBacc zDD*i>1q;noskSrnYQq{2Id+*Y&1cBSY(~N3D7A+x%wxxw{9$Hhrary}!a6oxMa5C( zR3krq`b0)XM&8}+Hi$x$j|KIdLWV;CbdxD%!zPS+Z zu~oq+#>|&v!ax`RYg*3o@lNVs4@YngAP9+Gn1{`rbyf%iri5aSN*pT0grbd|xlrq^ z2eR~0S#}geeKl6--0N=g>BgfIdsc#56-_8j)0Q4R|5%^i6&FFuD9qQkS>Q>dxz}Z6 zdOfy0OzH+)NeQ~o!Bak&i$dA?o(NIsNnDzO1K{QQ$!VUvlR(Ou7_tSXByT4RogqFg z(+J{4Kw{meOBc+>^DvyYkH(Sh0k9I`#n-}VNS|%Q10i}wIK|d&1en3rW4m9FK<~2;RUk)DCh$r zwk7Sv&fF0l+QJGKt7|!`NyFCmY%j^1&Z?I}Q{v59%#ZNR0t-AP`6>}Ja6%Ozy@sZu z?TABGx2p(hWK@ifGB)5B>^V5N>(N?5*v=fkdg%O zaK^g$8uo2kU28OY{=@95;Qz7VhrxuQqSh#G{mS|6Md1~jhE@bDfzpB{tC6yREMsqI zUMH^gLm`?vf$&^m$SP7c2Tu-gO_QRd%s~wA>7WoT#2N%~q%j?Wyb6bw9Ku$l!r|jA zB)4F37?kcuRprRoP&$&>yd2#Dv_#-aF4m!~ATU5`1Bq?YtojCqVapBTC~KhaCX7%0 z=!VPy7$8YbK?RG*0v#5ykm5a%jRNNsSY*RoG?NWoPC+s-l?$xXK-ll_K)R|$-pN93 z%T#0hK!sK+TYjZWcd?qAQm4F5Nz_#YEp`C>RCK$wR*p>`#!)ZFOm)-# zzboP8QP+$QJqL~aV(BJO`-;X)Pn^<=CH<=HZ{(Ul|O3 z7i7RBj*?}jNtJO!g-b_TZZ_;MH@kJ~R?>Lq-2{G*cImZ+ejVob2iifU`63YWXnit$ z`$r|!_VE*uQ;VJ<6B{PvyqZZ0EMFn!1AJF8lx6m-+zDa;PK)cVd;@=|f|f0u3_b@; z!l9+KLaSnMW4%TWMJR+U2Y-7JIc@|GtjDhm5<1~Xz}g>2z}lbwlQ|#}n5AFq(ALb6 zUPLvRptIg;&*s64iB%-8g?0EsN-{`dfMqkb&!)b{43zvS2ETv*4_WgOJZ4)4fg>1?Trw z_<;Eo$V}l5w=r=aU+(!&l&pr+uM|02Ve(vGi5yu=xj2{P&A=h}K1om$ZsM~5(mIy% z?786VM{tKuf&fH4$DWOiALo!r;l!bJM|@&_(}m1+as5NvZp_lWykz+9c*Su4w)pq% z^(G0SLs!T5`v9k(PyI&u$>?y=hVh{=n^V7fth<}Ex}i1BrMq%Gj(vxMs?Ztx7_W-4 z{`{u6v;|<~ExyRVEP8EAOm}(T$Dw!3OTgY=e%`Zd*IGEBfGC;+;BFXgv#z+={U_P_ zbYN#SfY9U2()mX5A9oG)WmWpZJ3|@Sg3r9qalp3A}jx{rbpl0?n9<;A1xGKHFK^ce?w4iTz~robER(Cdly6eT-0UyUf45A4 n(2;*25?RB6=KuD`%W-04qwAXhBhxT=dyiH)yE|QT3`qPZ<*72t literal 0 HcmV?d00001 diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 3c0407ee4098..f18e05dc2f1e 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -701,6 +701,16 @@ def test_sticky_tolerance(): axs.flat[3].barh(y=1, width=width, left=-20000.1) +@image_comparison(['sticky_tolerance_cf.png'], remove_text=True, style="mpl20") +def test_sticky_tolerance_contourf(): + fig, ax = plt.subplots() + + x = y = [14496.71, 14496.75] + data = [[0, 1], [2, 3]] + + ax.contourf(x, y, data) + + def test_nargs_stem(): with pytest.raises(TypeError, match='0 were given'): # stem() takes 1-3 arguments. From 2f12c03ab9d32b24c65ea186396d02e71d37b802 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Thu, 18 Jul 2024 14:04:45 -0500 Subject: [PATCH 09/37] Backport PR #28580: Bump actions/attest-build-provenance from 1.3.2 to 1.3.3 in the actions group --- .github/workflows/cibuildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 050ff16cfbbd..ef819ea5a438 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -203,7 +203,7 @@ jobs: run: ls dist - name: Generate artifact attestation for sdist and wheel - uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2 + uses: actions/attest-build-provenance@5e9cb68e95676991667494a6a4e59b8a2f13e1d0 # v1.3.3 with: subject-path: dist/matplotlib-* From c37449cf46d2da62c42cf3657c8913d176e6d076 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 19 Jul 2024 22:50:31 +0200 Subject: [PATCH 10/37] Backport PR #28518: [TYP] Fix overload of `pyplot.subplots` --- lib/matplotlib/figure.pyi | 2 +- lib/matplotlib/pyplot.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/figure.pyi b/lib/matplotlib/figure.pyi index b079312695c1..c31f90b4b2a8 100644 --- a/lib/matplotlib/figure.pyi +++ b/lib/matplotlib/figure.pyi @@ -132,7 +132,7 @@ class FigureBase(Artist): height_ratios: Sequence[float] | None = ..., subplot_kw: dict[str, Any] | None = ..., gridspec_kw: dict[str, Any] | None = ..., - ) -> Axes | np.ndarray: ... + ) -> Any: ... def delaxes(self, ax: Axes) -> None: ... def clear(self, keep_observers: bool = ...) -> None: ... def clf(self, keep_observers: bool = ...) -> None: ... diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 8b4769342c7d..442013f7d21a 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -1597,7 +1597,7 @@ def subplots( subplot_kw: dict[str, Any] | None = ..., gridspec_kw: dict[str, Any] | None = ..., **fig_kw -) -> tuple[Figure, Axes | np.ndarray]: +) -> tuple[Figure, Any]: ... From 99eaf725ec585ebe3d950492ce141c87b1d3d5c5 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 19 Jul 2024 19:18:51 -0400 Subject: [PATCH 11/37] Pin PyQt6 back on Ubuntu 20.04 The 6.7.1 wheels on PyPI do not conform to manylinux 2.28 due to requiring glibc 2.35 symbols, and cannot be loaded on Ubuntu 20.04, which has glibc 2.31. So we need to pin that back to avoid test failures. --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index daa07e62b2e5..634c83fa57fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -64,7 +64,7 @@ jobs: CFLAGS: "-fno-lto" # Ensure that disabling LTO works. # https://github.com/matplotlib/matplotlib/pull/26052#issuecomment-1574595954 # https://www.riverbankcomputing.com/pipermail/pyqt/2023-November/045606.html - pyqt6-ver: '!=6.5.1,!=6.6.0' + pyqt6-ver: '!=6.5.1,!=6.6.0,!=6.7.1' # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346 pyside6-ver: '!=6.5.1' - os: ubuntu-20.04 @@ -72,7 +72,7 @@ jobs: extra-requirements: '-r requirements/testing/extra.txt' # https://github.com/matplotlib/matplotlib/pull/26052#issuecomment-1574595954 # https://www.riverbankcomputing.com/pipermail/pyqt/2023-November/045606.html - pyqt6-ver: '!=6.5.1,!=6.6.0' + pyqt6-ver: '!=6.5.1,!=6.6.0,!=6.7.1' # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346 pyside6-ver: '!=6.5.1' - os: ubuntu-22.04 From b8be220c6937b10a36700d5aa6b02dae8cc8c458 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Tue, 23 Jul 2024 07:17:28 +0200 Subject: [PATCH 12/37] Backport PR #28604: cycler signature update. --- lib/matplotlib/axes/_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 17feef5b2105..6b3f2750575c 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -1548,7 +1548,7 @@ def set_prop_cycle(self, *args, **kwargs): Axes. If multiple properties are given, their value lists must have the same length. This is just a shortcut for explicitly creating a cycler and passing it to the function, i.e. it's short for - ``set_prop_cycle(cycler(label=values label2=values2, ...))``. + ``set_prop_cycle(cycler(label=values, label2=values2, ...))``. Form 3 creates a `~cycler.Cycler` for a single property and set it as the property cycle of the Axes. This form exists for compatibility From 4bedccf11b683b7b9ada06261818ab01ae56c659 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 29 Jul 2024 13:04:18 +0200 Subject: [PATCH 13/37] Backport PR #28621: TYP: Fix a typo in animation.pyi --- lib/matplotlib/animation.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/animation.pyi b/lib/matplotlib/animation.pyi index 56c27a465b7f..345e3c6dbe61 100644 --- a/lib/matplotlib/animation.pyi +++ b/lib/matplotlib/animation.pyi @@ -207,7 +207,7 @@ class FuncAnimation(TimedAnimation): self, fig: Figure, func: Callable[..., Iterable[Artist]], - frames: Iterable[Artist] | int | Callable[[], Generator] | None = ..., + frames: Iterable | int | Callable[[], Generator] | None = ..., init_func: Callable[[], Iterable[Artist]] | None = ..., fargs: tuple[Any, ...] | None = ..., save_count: int | None = ..., From 7457ba43b8362bb43de954fc46897e9da7738e02 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Thu, 1 Aug 2024 13:57:56 -0500 Subject: [PATCH 14/37] Backport PR #28625: added typing_extensions.Self to _AxesBase.twinx --- lib/matplotlib/axes/_base.pyi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/axes/_base.pyi b/lib/matplotlib/axes/_base.pyi index 751dcd248a5c..8cd88a92cc09 100644 --- a/lib/matplotlib/axes/_base.pyi +++ b/lib/matplotlib/axes/_base.pyi @@ -4,6 +4,7 @@ import datetime from collections.abc import Callable, Iterable, Iterator, Sequence from matplotlib import cbook from matplotlib.artist import Artist +from matplotlib.axes import Axes from matplotlib.axis import XAxis, YAxis, Tick from matplotlib.backend_bases import RendererBase, MouseButton, MouseEvent from matplotlib.cbook import CallbackRegistry @@ -384,8 +385,8 @@ class _AxesBase(martist.Artist): bbox_extra_artists: Sequence[Artist] | None = ..., for_layout_only: bool = ... ) -> Bbox | None: ... - def twinx(self) -> _AxesBase: ... - def twiny(self) -> _AxesBase: ... + def twinx(self) -> Axes: ... + def twiny(self) -> Axes: ... def get_shared_x_axes(self) -> cbook.GrouperView: ... def get_shared_y_axes(self) -> cbook.GrouperView: ... def label_outer(self, remove_inner_ticks: bool = ...) -> None: ... From 6ed77f6b6965408b6a07524e8fbcf77675593de2 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 1 Aug 2024 17:31:20 -0400 Subject: [PATCH 15/37] Backport PR #28634: Closed open div tag in color.ColorMap._repr_html_ --- lib/matplotlib/colors.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index 177557b371a6..5f40e7b0fb9a 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -960,6 +960,7 @@ def color_block(color): '' '
' f'over {color_block(self.get_over())}' + '
' '') def copy(self): From 105533f20837e152625269a32e9e11cfe9d93ef9 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 2 Aug 2024 01:28:29 -0400 Subject: [PATCH 16/37] Backport PR #28644: DOC: Fix matching for version switcher --- doc/conf.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index f43806a8b4c0..56e09a24b53a 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -496,10 +496,9 @@ def js_tag_with_cache_busting(js): f"https://matplotlib.org/devdocs/_static/switcher.json?{SHA}" ), "version_match": ( - # The start version to show. This must be in switcher.json. - # We either go to 'stable' or to 'devdocs' - 'stable' if matplotlib.__version_info__.releaselevel == 'final' - else 'devdocs') + matplotlib.__version__ + if matplotlib.__version_info__.releaselevel == 'final' + else 'dev') }, "navbar_end": ["theme-switcher", "version-switcher", "mpl_icon_links"], "navbar_persistent": ["search-button"], From ab258b73605635a0c6bc28d3e5e391232abd3292 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 2 Aug 2024 01:28:29 -0400 Subject: [PATCH 17/37] Backport PR #28644: DOC: Fix matching for version switcher --- doc/conf.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index f43806a8b4c0..56e09a24b53a 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -496,10 +496,9 @@ def js_tag_with_cache_busting(js): f"https://matplotlib.org/devdocs/_static/switcher.json?{SHA}" ), "version_match": ( - # The start version to show. This must be in switcher.json. - # We either go to 'stable' or to 'devdocs' - 'stable' if matplotlib.__version_info__.releaselevel == 'final' - else 'devdocs') + matplotlib.__version__ + if matplotlib.__version_info__.releaselevel == 'final' + else 'dev') }, "navbar_end": ["theme-switcher", "version-switcher", "mpl_icon_links"], "navbar_persistent": ["search-button"], From e7aba708ec6c8d834bc250bafa4e405d2736af38 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sat, 3 Aug 2024 05:42:17 -0400 Subject: [PATCH 18/37] Backport PR #28649: FIX: improve formatting of image values in cases of singular norms --- lib/matplotlib/artist.py | 4 +++- lib/matplotlib/cbook.py | 4 ++++ lib/matplotlib/tests/test_image.py | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index d5b8631e95df..735c2eb59cf5 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -1346,7 +1346,9 @@ def format_cursor_data(self, data): delta = np.diff( self.norm.boundaries[neigh_idx:cur_idx + 2] ).max() - + elif self.norm.vmin == self.norm.vmax: + # singular norms, use delta of 10% of only value + delta = np.abs(self.norm.vmin * .1) else: # Midpoints of neighboring color intervals. neighbors = self.norm.inverse( diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index a156ac200abf..f5a4199cf9ad 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -2252,6 +2252,10 @@ def _g_sig_digits(value, delta): it is known with an error of *delta*. """ if delta == 0: + if value == 0: + # if both value and delta are 0, np.spacing below returns 5e-324 + # which results in rather silly results + return 3 # delta = 0 may occur when trying to format values over a tiny range; # in that case, replace it by the distance to the closest float. delta = abs(np.spacing(value)) diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py index a043d3aec983..0c032fa5367a 100644 --- a/lib/matplotlib/tests/test_image.py +++ b/lib/matplotlib/tests/test_image.py @@ -411,7 +411,8 @@ def test_cursor_data_nonuniform(xy, data): ([[.123, .987]], "[0.123]"), ([[np.nan, 1, 2]], "[]"), ([[1, 1+1e-15]], "[1.0000000000000000]"), - ([[-1, -1]], "[-1.0000000000000000]"), + ([[-1, -1]], "[-1.0]"), + ([[0, 0]], "[0.00]"), ]) def test_format_cursor_data(data, text): from matplotlib.backend_bases import MouseEvent From e68bfdbea55b60c566de04d41a2b1d95544ea833 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 31 Jul 2024 06:34:27 +0200 Subject: [PATCH 19/37] Backport PR #28546: DOC: Clarify/simplify example of multiple images with one colorbar --- .../images_contours_and_fields/multi_image.py | 88 +++++++++++-------- 1 file changed, 51 insertions(+), 37 deletions(-) diff --git a/galleries/examples/images_contours_and_fields/multi_image.py b/galleries/examples/images_contours_and_fields/multi_image.py index 5634a32abeb9..8be048055dec 100644 --- a/galleries/examples/images_contours_and_fields/multi_image.py +++ b/galleries/examples/images_contours_and_fields/multi_image.py @@ -1,9 +1,19 @@ """ -=============== -Multiple images -=============== +================================= +Multiple images with one colorbar +================================= -Make a set of images with a single colormap, norm, and colorbar. +Use a single colorbar for multiple images. + +Currently, a colorbar can only be connected to one image. The connection +guarantees that the data coloring is consistent with the colormap scale +(i.e. the color of value *x* in the colormap is used for coloring a data +value *x* in the image). + +If we want one colorbar to be representative for multiple images, we have +to explicitly ensure consistent data coloring by using the same data +normalization for all the images. We ensure this by explicitly creating a +``norm`` object that we pass to all the image plotting methods. """ import matplotlib.pyplot as plt @@ -12,47 +22,53 @@ from matplotlib import colors np.random.seed(19680801) -Nr = 3 -Nc = 2 -fig, axs = plt.subplots(Nr, Nc) +datasets = [ + (i+1)/10 * np.random.rand(10, 20) + for i in range(4) +] + +fig, axs = plt.subplots(2, 2) fig.suptitle('Multiple images') -images = [] -for i in range(Nr): - for j in range(Nc): - # Generate data with a range that varies from one plot to the next. - data = ((1 + i + j) / 10) * np.random.rand(10, 20) - images.append(axs[i, j].imshow(data)) - axs[i, j].label_outer() +# create a single norm to be shared across all images +norm = colors.Normalize(vmin=np.min(datasets), vmax=np.max(datasets)) -# Find the min and max of all colors for use in setting the color scale. -vmin = min(image.get_array().min() for image in images) -vmax = max(image.get_array().max() for image in images) -norm = colors.Normalize(vmin=vmin, vmax=vmax) -for im in images: - im.set_norm(norm) +images = [] +for ax, data in zip(axs.flat, datasets): + images.append(ax.imshow(data, norm=norm)) fig.colorbar(images[0], ax=axs, orientation='horizontal', fraction=.1) - -# Make images respond to changes in the norm of other images (e.g. via the -# "edit axis, curves and images parameters" GUI on Qt), but be careful not to -# recurse infinitely! -def update(changed_image): - for im in images: - if (changed_image.get_cmap() != im.get_cmap() - or changed_image.get_clim() != im.get_clim()): - im.set_cmap(changed_image.get_cmap()) - im.set_clim(changed_image.get_clim()) - - -for im in images: - im.callbacks.connect('changed', update) - plt.show() # %% +# The colors are now kept consistent across all images when changing the +# scaling, e.g. through zooming in the colorbar or via the "edit axis, +# curves and images parameters" GUI of the Qt backend. This is sufficient +# for most practical use cases. +# +# Advanced: Additionally sync the colormap +# ---------------------------------------- +# +# Sharing a common norm object guarantees synchronized scaling because scale +# changes modify the norm object in-place and thus propagate to all images +# that use this norm. This approach does not help with synchronizing colormaps +# because changing the colormap of an image (e.g. through the "edit axis, +# curves and images parameters" GUI of the Qt backend) results in the image +# referencing the new colormap object. Thus, the other images are not updated. +# +# To update the other images, sync the +# colormaps using the following code:: +# +# def sync_cmaps(changed_image): +# for im in images: +# if changed_image.get_cmap() != im.get_cmap(): +# im.set_cmap(changed_image.get_cmap()) +# +# for im in images: +# im.callbacks.connect('changed', sync_cmaps) +# # # .. admonition:: References # @@ -63,6 +79,4 @@ def update(changed_image): # - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar` # - `matplotlib.colors.Normalize` # - `matplotlib.cm.ScalarMappable.set_cmap` -# - `matplotlib.cm.ScalarMappable.set_norm` -# - `matplotlib.cm.ScalarMappable.set_clim` # - `matplotlib.cbook.CallbackRegistry.connect` From 6c7dbc06ebc50d4833189605b4fdc6a30ea8f283 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 31 Jul 2024 06:34:27 +0200 Subject: [PATCH 20/37] Backport PR #28546: DOC: Clarify/simplify example of multiple images with one colorbar --- .../images_contours_and_fields/multi_image.py | 88 +++++++++++-------- 1 file changed, 51 insertions(+), 37 deletions(-) diff --git a/galleries/examples/images_contours_and_fields/multi_image.py b/galleries/examples/images_contours_and_fields/multi_image.py index 5634a32abeb9..8be048055dec 100644 --- a/galleries/examples/images_contours_and_fields/multi_image.py +++ b/galleries/examples/images_contours_and_fields/multi_image.py @@ -1,9 +1,19 @@ """ -=============== -Multiple images -=============== +================================= +Multiple images with one colorbar +================================= -Make a set of images with a single colormap, norm, and colorbar. +Use a single colorbar for multiple images. + +Currently, a colorbar can only be connected to one image. The connection +guarantees that the data coloring is consistent with the colormap scale +(i.e. the color of value *x* in the colormap is used for coloring a data +value *x* in the image). + +If we want one colorbar to be representative for multiple images, we have +to explicitly ensure consistent data coloring by using the same data +normalization for all the images. We ensure this by explicitly creating a +``norm`` object that we pass to all the image plotting methods. """ import matplotlib.pyplot as plt @@ -12,47 +22,53 @@ from matplotlib import colors np.random.seed(19680801) -Nr = 3 -Nc = 2 -fig, axs = plt.subplots(Nr, Nc) +datasets = [ + (i+1)/10 * np.random.rand(10, 20) + for i in range(4) +] + +fig, axs = plt.subplots(2, 2) fig.suptitle('Multiple images') -images = [] -for i in range(Nr): - for j in range(Nc): - # Generate data with a range that varies from one plot to the next. - data = ((1 + i + j) / 10) * np.random.rand(10, 20) - images.append(axs[i, j].imshow(data)) - axs[i, j].label_outer() +# create a single norm to be shared across all images +norm = colors.Normalize(vmin=np.min(datasets), vmax=np.max(datasets)) -# Find the min and max of all colors for use in setting the color scale. -vmin = min(image.get_array().min() for image in images) -vmax = max(image.get_array().max() for image in images) -norm = colors.Normalize(vmin=vmin, vmax=vmax) -for im in images: - im.set_norm(norm) +images = [] +for ax, data in zip(axs.flat, datasets): + images.append(ax.imshow(data, norm=norm)) fig.colorbar(images[0], ax=axs, orientation='horizontal', fraction=.1) - -# Make images respond to changes in the norm of other images (e.g. via the -# "edit axis, curves and images parameters" GUI on Qt), but be careful not to -# recurse infinitely! -def update(changed_image): - for im in images: - if (changed_image.get_cmap() != im.get_cmap() - or changed_image.get_clim() != im.get_clim()): - im.set_cmap(changed_image.get_cmap()) - im.set_clim(changed_image.get_clim()) - - -for im in images: - im.callbacks.connect('changed', update) - plt.show() # %% +# The colors are now kept consistent across all images when changing the +# scaling, e.g. through zooming in the colorbar or via the "edit axis, +# curves and images parameters" GUI of the Qt backend. This is sufficient +# for most practical use cases. +# +# Advanced: Additionally sync the colormap +# ---------------------------------------- +# +# Sharing a common norm object guarantees synchronized scaling because scale +# changes modify the norm object in-place and thus propagate to all images +# that use this norm. This approach does not help with synchronizing colormaps +# because changing the colormap of an image (e.g. through the "edit axis, +# curves and images parameters" GUI of the Qt backend) results in the image +# referencing the new colormap object. Thus, the other images are not updated. +# +# To update the other images, sync the +# colormaps using the following code:: +# +# def sync_cmaps(changed_image): +# for im in images: +# if changed_image.get_cmap() != im.get_cmap(): +# im.set_cmap(changed_image.get_cmap()) +# +# for im in images: +# im.callbacks.connect('changed', sync_cmaps) +# # # .. admonition:: References # @@ -63,6 +79,4 @@ def update(changed_image): # - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar` # - `matplotlib.colors.Normalize` # - `matplotlib.cm.ScalarMappable.set_cmap` -# - `matplotlib.cm.ScalarMappable.set_norm` -# - `matplotlib.cm.ScalarMappable.set_clim` # - `matplotlib.cbook.CallbackRegistry.connect` From 2a8d1fc7a4a0303c534b6452c752c79122ecf926 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:05:43 +0200 Subject: [PATCH 21/37] Backport PR #28650: remove out of date todos on animation.py --- lib/matplotlib/animation.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index 1efb72cb52e6..5a4764f1a79f 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -1,23 +1,3 @@ -# TODO: -# * Documentation -- this will need a new section of the User's Guide. -# Both for Animations and just timers. -# - Also need to update -# https://scipy-cookbook.readthedocs.io/items/Matplotlib_Animations.html -# * Blit -# * Currently broken with Qt4 for widgets that don't start on screen -# * Still a few edge cases that aren't working correctly -# * Can this integrate better with existing matplotlib animation artist flag? -# - If animated removes from default draw(), perhaps we could use this to -# simplify initial draw. -# * Example -# * Frameless animation - pure procedural with no loop -# * Need example that uses something like inotify or subprocess -# * Complex syncing examples -# * Movies -# * Can blit be enabled for movies? -# * Need to consider event sources to allow clicking through multiple figures - - import abc import base64 import contextlib From 1bb9c02173f86efee085c9e771a61a449be6e02d Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Wed, 7 Aug 2024 15:48:15 -0500 Subject: [PATCH 22/37] Backport PR #28577: Copy all internals from initial Tick to lazy ones --- lib/matplotlib/axis.py | 33 ++++++++++++++++++++----------- lib/matplotlib/tests/test_axes.py | 22 +++++++++++++++++++++ 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 3afc98fac60b..98f7db89b09f 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -33,12 +33,6 @@ _gridline_param_names = ['grid_' + name for name in _line_param_names + _line_param_aliases] -_MARKER_DICT = { - 'out': (mlines.TICKDOWN, mlines.TICKUP), - 'in': (mlines.TICKUP, mlines.TICKDOWN), - 'inout': ('|', '|'), -} - class Tick(martist.Artist): """ @@ -204,18 +198,21 @@ def _set_labelrotation(self, labelrotation): _api.check_in_list(['auto', 'default'], labelrotation=mode) self._labelrotation = (mode, angle) + @property + def _pad(self): + return self._base_pad + self.get_tick_padding() + def _apply_tickdir(self, tickdir): """Set tick direction. Valid values are 'out', 'in', 'inout'.""" - # This method is responsible for updating `_pad`, and, in subclasses, - # for setting the tick{1,2}line markers as well. From the user - # perspective this should always be called through _apply_params, which - # further updates ticklabel positions using the new pads. + # This method is responsible for verifying input and, in subclasses, for setting + # the tick{1,2}line markers. From the user perspective this should always be + # called through _apply_params, which further updates ticklabel positions using + # the new pads. if tickdir is None: tickdir = mpl.rcParams[f'{self.__name__}.direction'] else: _api.check_in_list(['in', 'out', 'inout'], tickdir=tickdir) self._tickdir = tickdir - self._pad = self._base_pad + self.get_tick_padding() def get_tickdir(self): return self._tickdir @@ -425,7 +422,11 @@ def _get_text2_transform(self): def _apply_tickdir(self, tickdir): # docstring inherited super()._apply_tickdir(tickdir) - mark1, mark2 = _MARKER_DICT[self._tickdir] + mark1, mark2 = { + 'out': (mlines.TICKDOWN, mlines.TICKUP), + 'in': (mlines.TICKUP, mlines.TICKDOWN), + 'inout': ('|', '|'), + }[self._tickdir] self.tick1line.set_marker(mark1) self.tick2line.set_marker(mark2) @@ -1617,6 +1618,14 @@ def _copy_tick_props(self, src, dest): dest.tick1line.update_from(src.tick1line) dest.tick2line.update_from(src.tick2line) dest.gridline.update_from(src.gridline) + dest.update_from(src) + dest._loc = src._loc + dest._size = src._size + dest._width = src._width + dest._base_pad = src._base_pad + dest._labelrotation = src._labelrotation + dest._zorder = src._zorder + dest._tickdir = src._tickdir def get_label_text(self): """Get the text of the label.""" diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index f18e05dc2f1e..3ec9923c0840 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -5631,6 +5631,28 @@ def test_reset_ticks(fig_test, fig_ref): ax.yaxis.reset_ticks() +@mpl.style.context('mpl20') +def test_context_ticks(): + with plt.rc_context({ + 'xtick.direction': 'in', 'xtick.major.size': 30, 'xtick.major.width': 5, + 'xtick.color': 'C0', 'xtick.major.pad': 12, + 'xtick.bottom': True, 'xtick.top': True, + 'xtick.labelsize': 14, 'xtick.labelcolor': 'C1'}): + fig, ax = plt.subplots() + # Draw outside the context so that all-but-first tick are generated with the normal + # mpl20 style in place. + fig.draw_without_rendering() + + first_tick = ax.xaxis.majorTicks[0] + for tick in ax.xaxis.majorTicks[1:]: + assert tick._size == first_tick._size + assert tick._width == first_tick._width + assert tick._base_pad == first_tick._base_pad + assert tick._labelrotation == first_tick._labelrotation + assert tick._zorder == first_tick._zorder + assert tick._tickdir == first_tick._tickdir + + def test_vline_limit(): fig = plt.figure() ax = fig.gca() From c57960c89497163dd80f13244c00a429a5469c62 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Thu, 8 Aug 2024 11:31:47 -0500 Subject: [PATCH 23/37] Backport PR #28682: Fix warnings from mingw compilers --- src/_c_internal_utils.cpp | 13 ++++++++++--- src/_tkagg.cpp | 9 ++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/_c_internal_utils.cpp b/src/_c_internal_utils.cpp index e118183ecc8b..74bb97904f89 100644 --- a/src/_c_internal_utils.cpp +++ b/src/_c_internal_utils.cpp @@ -7,7 +7,14 @@ #define WIN32_LEAN_AND_MEAN // Windows 10, for latest HiDPI API support. #define WINVER 0x0A00 -#define _WIN32_WINNT 0x0A00 +#if defined(_WIN32_WINNT) +#if _WIN32_WINNT < WINVER +#undef _WIN32_WINNT +#define _WIN32_WINNT WINVER +#endif +#else +#define _WIN32_WINNT WINVER +#endif #endif #include #ifdef __linux__ @@ -125,7 +132,7 @@ static void mpl_SetForegroundWindow(py::capsule UNUSED_ON_NON_WINDOWS(handle_p)) { #ifdef _WIN32 - if (handle_p.name() != "HWND") { + if (strcmp(handle_p.name(), "HWND") != 0) { throw std::runtime_error("Handle must be a value returned from Win32_GetForegroundWindow"); } HWND handle = static_cast(handle_p.get_pointer()); @@ -158,7 +165,7 @@ mpl_SetProcessDpiAwareness_max(void) DPI_AWARENESS_CONTEXT_SYSTEM_AWARE}; // Win10 if (IsValidDpiAwarenessContextPtr != NULL && SetProcessDpiAwarenessContextPtr != NULL) { - for (int i = 0; i < sizeof(ctxs) / sizeof(DPI_AWARENESS_CONTEXT); ++i) { + for (size_t i = 0; i < sizeof(ctxs) / sizeof(DPI_AWARENESS_CONTEXT); ++i) { if (IsValidDpiAwarenessContextPtr(ctxs[i])) { SetProcessDpiAwarenessContextPtr(ctxs[i]); break; diff --git a/src/_tkagg.cpp b/src/_tkagg.cpp index e35502fe23ff..bfc2253188fd 100644 --- a/src/_tkagg.cpp +++ b/src/_tkagg.cpp @@ -19,7 +19,14 @@ #define WIN32_LEAN_AND_MEAN // Windows 8.1 #define WINVER 0x0603 -#define _WIN32_WINNT 0x0603 +#if defined(_WIN32_WINNT) +#if _WIN32_WINNT < WINVER +#undef _WIN32_WINNT +#define _WIN32_WINNT WINVER +#endif +#else +#define _WIN32_WINNT WINVER +#endif #endif #include From e40125ac7f17de880ebc8177e82a16c194779f2a Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 25 Jul 2024 15:39:40 -0400 Subject: [PATCH 24/37] Backport PR #28293 and #28668: Enable 3.13 wheels and bump cibuildwheel This is the commit message #1: > Merge pull request #28293 from QuLogic/py313 > > BLD: Enable building Python 3.13 wheels for nightlies (cherry picked from commit 725ee995000985b2ee24d1b21cd777e0811272c8) This is the commit message #2: > Merge pull request #28668 from matplotlib/dependabot/github_actions/actions-167bd8b160 > > Bump the actions group with 2 updates (cherry picked from commit fd42e7d63577ef88694913268fe5a5ffd8539431) --- .github/workflows/cibuildwheel.yml | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index ef819ea5a438..4e8ea0ab5bf6 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -134,8 +134,28 @@ jobs: name: cibw-sdist path: dist/ + - name: Build wheels for CPython 3.13 + uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0 + with: + package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} + env: + CIBW_BUILD: "cp313-* cp313t-*" + # No free-threading wheels for NumPy; musllinux skipped for main builds also. + CIBW_SKIP: "cp313t-win_amd64 *-musllinux_aarch64" + CIBW_BUILD_FRONTEND: + "pip; args: --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" + CIBW_FREE_THREADED_SUPPORT: true + # No free-threading wheels available for aarch64 on Pillow. + CIBW_TEST_SKIP: "cp313t-manylinux_aarch64" + # We need pre-releases to get the nightly wheels. + CIBW_BEFORE_TEST: >- + pip install --pre + --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + contourpy numpy pillow + CIBW_ARCHS: ${{ matrix.cibw_archs }} + - name: Build wheels for CPython 3.12 - uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2 + uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -143,7 +163,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for CPython 3.11 - uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2 + uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -151,7 +171,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for CPython 3.10 - uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2 + uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -167,7 +187,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for PyPy - uses: pypa/cibuildwheel@7e5a838a63ac8128d71ab2dfd99e4634dd1bca09 # v2.19.2 + uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -203,7 +223,7 @@ jobs: run: ls dist - name: Generate artifact attestation for sdist and wheel - uses: actions/attest-build-provenance@5e9cb68e95676991667494a6a4e59b8a2f13e1d0 # v1.3.3 + uses: actions/attest-build-provenance@210c1913531870065f03ce1f9440dd87bc0938cd # v1.4.0 with: subject-path: dist/matplotlib-* From 465401ed3000baff801e8f14592754cf80ce25d9 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 9 Aug 2024 14:15:32 +0200 Subject: [PATCH 25/37] Backport PR #28632: DOC: Tell sphinx-gallery to link mpl_toolkits from our build --- doc/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 56e09a24b53a..843766a804ea 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -263,7 +263,8 @@ def _check_dependencies(): 'matplotlib_animations': True, 'min_reported_time': 1, 'plot_gallery': 'True', # sphinx-gallery/913 - 'reference_url': {'matplotlib': None}, + 'reference_url': {'matplotlib': None, 'mpl_toolkits': None}, + 'prefer_full_module': {r'mpl_toolkits\.'}, 'remove_config_comments': True, 'reset_modules': ('matplotlib', clear_basic_units), 'subsection_order': gallery_order_sectionorder, From d88a582fb14accd95e80a25a567b1d1bb08561d0 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Fri, 9 Aug 2024 12:17:28 -0500 Subject: [PATCH 26/37] Backport PR #27797: DOC: Use video files for saving animations --- doc/conf.py | 7 ++++++- requirements/doc/doc-requirements.txt | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 843766a804ea..8036edec9989 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -194,6 +194,11 @@ def _check_dependencies(): subsectionorder as gallery_order_subsectionorder) from sphinxext.util import clear_basic_units, matplotlib_reduced_latex_scraper +if parse_version(sphinx_gallery.__version__) >= parse_version('0.17.0'): + sg_matplotlib_animations = (True, 'mp4') +else: + sg_matplotlib_animations = True + # The following import is only necessary to monkey patch the signature later on from sphinx_gallery import gen_rst @@ -260,7 +265,7 @@ def _check_dependencies(): 'image_scrapers': (matplotlib_reduced_latex_scraper, ), 'image_srcset': ["2x"], 'junit': '../test-results/sphinx-gallery/junit.xml' if CIRCLECI else '', - 'matplotlib_animations': True, + 'matplotlib_animations': sg_matplotlib_animations, 'min_reported_time': 1, 'plot_gallery': 'True', # sphinx-gallery/913 'reference_url': {'matplotlib': None, 'mpl_toolkits': None}, diff --git a/requirements/doc/doc-requirements.txt b/requirements/doc/doc-requirements.txt index 87bc483b15c0..ee74d02f7146 100644 --- a/requirements/doc/doc-requirements.txt +++ b/requirements/doc/doc-requirements.txt @@ -18,6 +18,7 @@ pydata-sphinx-theme~=0.15.0 mpl-sphinx-theme~=3.9.0 pyyaml sphinxcontrib-svg2pdfconverter>=1.1.0 +sphinxcontrib-video>=0.2.1 sphinx-copybutton sphinx-design sphinx-gallery>=0.12.0 From 8a62afa5dd0fd8e9fa4d30f8960f38d882728212 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 8 Aug 2024 15:34:39 -0400 Subject: [PATCH 27/37] BLD: Include MSVCP140 runtime statically This should prevent conflicts with other wheels that use the runtime at a different version. --- .github/workflows/cibuildwheel.yml | 10 +++++++++- doc/api/next_api_changes/development/28687-ES.rst | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 doc/api/next_api_changes/development/28687-ES.rst diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 4e8ea0ab5bf6..9de63b14c4fd 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -100,7 +100,15 @@ jobs: CIBW_AFTER_BUILD: >- twine check {wheel} && python {package}/ci/check_wheel_licenses.py {wheel} - CIBW_CONFIG_SETTINGS: setup-args="--vsenv" + # On Windows, we explicitly request MSVC compilers (as GitHub Action runners have + # MinGW on PATH that would be picked otherwise), switch to a static build for + # runtimes, but use dynamic linking for `VCRUNTIME140.dll`, `VCRUNTIME140_1.dll`, + # and the UCRT. This avoids requiring specific versions of `MSVCP140.dll`, while + # keeping shared state with the rest of the Python process/extensions. + CIBW_CONFIG_SETTINGS_WINDOWS: >- + setup-args="--vsenv" + setup-args="-Db_vscrt=mt" + setup-args="-Dcpp_link_args=['ucrt.lib','vcruntime.lib','/nodefaultlib:libucrt.lib','/nodefaultlib:libvcruntime.lib']" CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_SKIP: "*-musllinux_aarch64" CIBW_TEST_COMMAND: >- diff --git a/doc/api/next_api_changes/development/28687-ES.rst b/doc/api/next_api_changes/development/28687-ES.rst new file mode 100644 index 000000000000..339dafdd05d0 --- /dev/null +++ b/doc/api/next_api_changes/development/28687-ES.rst @@ -0,0 +1,10 @@ +Windows wheel runtime bundling made static +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In 3.7.0, the MSVC runtime DLL was bundled in wheels to enable importing Matplotlib on +systems that do not have it installed. However, this could cause inconsistencies with +other wheels that did the same, and trigger random crashes depending on import order. See +`this issue `_ for further +details. + +Since 3.9.2, wheels now bundle the MSVC runtime DLL statically to avoid such issues. From 056f307c1eaceb7615594e02b03336ec047ef02d Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 12 Aug 2024 19:25:14 -0400 Subject: [PATCH 28/37] DOC: Create release notes for 3.9.2 --- .../api_changes_3.9.2.rst} | 6 + doc/users/github_stats.rst | 236 ++++++------------ .../prev_whats_new/github_stats_3.9.1.rst | 192 ++++++++++++++ doc/users/release_notes.rst | 2 + 4 files changed, 270 insertions(+), 166 deletions(-) rename doc/api/{next_api_changes/development/28687-ES.rst => prev_api_changes/api_changes_3.9.2.rst} (88%) create mode 100644 doc/users/prev_whats_new/github_stats_3.9.1.rst diff --git a/doc/api/next_api_changes/development/28687-ES.rst b/doc/api/prev_api_changes/api_changes_3.9.2.rst similarity index 88% rename from doc/api/next_api_changes/development/28687-ES.rst rename to doc/api/prev_api_changes/api_changes_3.9.2.rst index 339dafdd05d0..4c2a69634502 100644 --- a/doc/api/next_api_changes/development/28687-ES.rst +++ b/doc/api/prev_api_changes/api_changes_3.9.2.rst @@ -1,3 +1,9 @@ +API Changes for 3.9.2 +===================== + +Development +----------- + Windows wheel runtime bundling made static ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/users/github_stats.rst b/doc/users/github_stats.rst index 0c8f29687afb..00c3e5d656a1 100644 --- a/doc/users/github_stats.rst +++ b/doc/users/github_stats.rst @@ -1,195 +1,99 @@ .. _github-stats: -GitHub statistics for 3.9.1 (Jul 04, 2024) +GitHub statistics for 3.9.2 (Aug 12, 2024) ========================================== -GitHub statistics for 2024/05/15 (tag: v3.9.0) - 2024/07/04 +GitHub statistics for 2024/07/04 (tag: v3.9.1) - 2024/08/12 These lists are automatically generated, and may be incomplete or contain duplicates. -We closed 30 issues and merged 111 pull requests. -The full list can be seen `on GitHub `__ +We closed 9 issues and merged 45 pull requests. +The full list can be seen `on GitHub `__ -The following 29 authors contributed 184 commits. +The following 20 authors contributed 67 commits. -* Antony Lee -* Brigitta Sipőcz -* Christian Mattsson -* dale +* Adam J. Stewart +* Anthony Lee +* Caitlin Hathaway +* ClarkeAC * dependabot[bot] * Elliott Sales de Andrade -* Eytan Adler +* Filippo Balzaretti * Greg Lucas -* haaris * hannah * Ian Thomas -* Illviljan -* K900 +* Jody Klymak * Kyle Sunden -* Lumberbot (aka Jack) -* malhar2460 -* Matthew Feickert -* Melissa Weber Mendonça -* MischaMegens2 * Oscar Gustafsson +* Randolf Scholz +* Refael Ackermann * Ruth Comer * Scott Shambaugh -* simond07 -* SjoerdB93 -* Takumasa N -* Takumasa N. -* Takumasa Nakamura +* Sean Smith * Thomas A Caswell * Tim Hoffmann GitHub issues and pull requests: -Pull Requests (111): +Pull Requests (45): -* :ghpull:`28507`: Backport PR #28430 on branch v3.9.x (Fix pickling of AxesWidgets.) -* :ghpull:`28506`: Backport PR #28451 on branch v3.9.x (Fix GTK cairo backends) -* :ghpull:`28430`: Fix pickling of AxesWidgets. -* :ghpull:`25861`: Fix Hidpi scaling for GTK4Cairo -* :ghpull:`28451`: Fix GTK cairo backends -* :ghpull:`28499`: Backport PR #28498 on branch v3.9.x (Don't fail if we can't query system fonts on macOS) -* :ghpull:`28498`: Don't fail if we can't query system fonts on macOS -* :ghpull:`28491`: Backport PR #28487 on branch v3.9.x (Fix autoscaling with axhspan) -* :ghpull:`28490`: Backport PR #28486 on branch v3.9.x (Fix CompositeGenericTransform.contains_branch_seperately) -* :ghpull:`28487`: Fix autoscaling with axhspan -* :ghpull:`28486`: Fix CompositeGenericTransform.contains_branch_seperately -* :ghpull:`28483`: Backport PR #28393 on branch v3.9.x (Make sticky edges only apply if the sticky edge is the most extreme limit point) -* :ghpull:`28482`: Backport PR #28473 on branch v3.9.x (Do not lowercase module:// backends) -* :ghpull:`28393`: Make sticky edges only apply if the sticky edge is the most extreme limit point -* :ghpull:`28473`: Do not lowercase module:// backends -* :ghpull:`28480`: Backport PR #28474 on branch v3.9.x (Fix typing and docs for containers) -* :ghpull:`28479`: Backport PR #28397 (FIX: stale root Figure when adding/updating subfigures) -* :ghpull:`28474`: Fix typing and docs for containers -* :ghpull:`28472`: Backport PR #28289 on branch v3.9.x (Promote mpltype Sphinx role to a public extension) -* :ghpull:`28471`: Backport PR #28342 on branch v3.9.x (DOC: Document the parameter *position* of apply_aspect() as internal) -* :ghpull:`28470`: Backport PR #28398 on branch v3.9.x (Add GIL Release to flush_events in macosx backend) -* :ghpull:`28469`: Backport PR #28355 on branch v3.9.x (MNT: Re-add matplotlib.cm.get_cmap) -* :ghpull:`28397`: FIX: stale root Figure when adding/updating subfigures -* :ghpull:`28289`: Promote mpltype Sphinx role to a public extension -* :ghpull:`28342`: DOC: Document the parameter *position* of apply_aspect() as internal -* :ghpull:`28398`: Add GIL Release to flush_events in macosx backend -* :ghpull:`28355`: MNT: Re-add matplotlib.cm.get_cmap -* :ghpull:`28468`: Backport PR #28465 on branch v3.9.x (Fix pickling of SubFigures) -* :ghpull:`28465`: Fix pickling of SubFigures -* :ghpull:`28462`: Backport PR #28440 on branch v3.9.x (DOC: Add note about simplification of to_polygons) -* :ghpull:`28460`: Backport PR #28459 on branch v3.9.x (DOC: Document kwargs scope for tick setter functions) -* :ghpull:`28461`: Backport PR #28458 on branch v3.9.x (Correct numpy dtype comparisons in image_resample) -* :ghpull:`28440`: DOC: Add note about simplification of to_polygons -* :ghpull:`28458`: Correct numpy dtype comparisons in image_resample -* :ghpull:`28459`: DOC: Document kwargs scope for tick setter functions -* :ghpull:`28450`: Backport of 28371 and 28411 -* :ghpull:`28446`: Backport PR #28403 on branch v3.9.x (FIX: Autoscale support in add_collection3d for Line3DCollection and Poly3DCollection -* :ghpull:`28445`: Backport PR #28403 on branch v3.9.x (FIX: Autoscale support in add_collection3d for Line3DCollection and Poly3DCollection) -* :ghpull:`28438`: Backport PR #28436 on branch v3.9.x (Fix ``is_color_like`` for 2-tuple of strings and fix ``to_rgba`` for ``(nth_color, alpha)``) -* :ghpull:`28403`: FIX: Autoscale support in add_collection3d for Line3DCollection and Poly3DCollection -* :ghpull:`28443`: Backport PR #28441 on branch v3.9.x (MNT: Update basic units example to work with numpy 2.0) -* :ghpull:`28441`: MNT: Update basic units example to work with numpy 2.0 -* :ghpull:`28436`: Fix ``is_color_like`` for 2-tuple of strings and fix ``to_rgba`` for ``(nth_color, alpha)`` -* :ghpull:`28426`: Backport PR #28425 on branch v3.9.x (Fix Circle yaml line length) -* :ghpull:`28427`: Fix circleci yaml -* :ghpull:`28425`: Fix Circle yaml line length -* :ghpull:`28422`: Backport PR #28401 on branch v3.9.x (FIX: Fix text wrapping) -* :ghpull:`28424`: Backport PR #28423 on branch v3.9.x (Update return type for Axes.axhspan and Axes.axvspan) -* :ghpull:`28423`: Update return type for Axes.axhspan and Axes.axvspan -* :ghpull:`28401`: FIX: Fix text wrapping -* :ghpull:`28419`: Backport PR #28414 on branch v3.9.x (Clean up obsolete widget code) -* :ghpull:`28411`: Bump the actions group with 3 updates -* :ghpull:`28414`: Clean up obsolete widget code -* :ghpull:`28415`: Backport PR #28413 on branch v3.9.x (CI: update action that got moved org) -* :ghpull:`28413`: CI: update action that got moved org -* :ghpull:`28392`: Backport PR #28388 on branch v3.9.x (Allow duplicate (name, value) entry points for backends) -* :ghpull:`28362`: Backport PR #28337 on branch v3.9.x (Bump the actions group across 1 directory with 3 updates) -* :ghpull:`28388`: Allow duplicate (name, value) entry points for backends -* :ghpull:`28389`: Backport PR #28380 on branch v3.9.x (Remove outdated docstring section in RendererBase.draw_text.) -* :ghpull:`28380`: Remove outdated docstring section in RendererBase.draw_text. -* :ghpull:`28385`: Backport PR #28377 on branch v3.9.x (DOC: Clarify scope of wrap.) -* :ghpull:`28377`: DOC: Clarify scope of wrap. -* :ghpull:`28368`: Backport PR #28359 on branch v3.9.x (Document that axes unsharing is impossible.) -* :ghpull:`28359`: Document that axes unsharing is impossible. -* :ghpull:`28337`: Bump the actions group across 1 directory with 3 updates -* :ghpull:`28351`: Backport PR #28307 on branch v3.9.x (DOC: New color line by value example) -* :ghpull:`28307`: DOC: New color line by value example -* :ghpull:`28339`: Backport PR #28336 on branch v3.9.x (DOC: Add version warning banner for docs versions different from stable) -* :ghpull:`28336`: DOC: Add version warning banner for docs versions different from stable -* :ghpull:`28334`: Backport PR #28332 on branch v3.9.x (Call IPython.enable_gui when install repl displayhook) -* :ghpull:`28332`: Call IPython.enable_gui when install repl displayhook -* :ghpull:`28331`: Backport PR #28329 on branch v3.9.x (DOC: Add example for 3D intersecting planes) -* :ghpull:`28329`: DOC: Add example for 3D intersecting planes -* :ghpull:`28327`: Backport PR #28292 on branch v3.9.x (Resolve MaxNLocator IndexError when no large steps) -* :ghpull:`28292`: Resolve MaxNLocator IndexError when no large steps -* :ghpull:`28326`: Backport PR #28041 on branch v3.9.x ([BUG]: Shift box_aspect according to vertical_axis) -* :ghpull:`28041`: [BUG]: Shift box_aspect according to vertical_axis -* :ghpull:`28320`: Backport PR #27001 on branch v3.9.x ([TYP] Add overload of ``pyplot.subplots``) -* :ghpull:`27001`: [TYP] Add overload of ``pyplot.subplots`` -* :ghpull:`28318`: Backport PR #28273 on branch v3.9.x (CI: Add GitHub artifact attestations to package distribution) -* :ghpull:`28273`: CI: Add GitHub artifact attestations to package distribution -* :ghpull:`28305`: Backport PR #28303 on branch v3.9.x (Removed drawedges repeated definition from function doc string) -* :ghpull:`28303`: Removed drawedges repeated definition from function doc string -* :ghpull:`28299`: Backport PR #28297 on branch v3.9.x (Solved #28296 Added missing comma) -* :ghpull:`28297`: Solved #28296 Added missing comma -* :ghpull:`28294`: Backport PR #28261 on branch v3.9.x (Correct roll angle units, issue #28256) -* :ghpull:`28261`: Correct roll angle units, issue #28256 -* :ghpull:`28283`: Backport PR #28280 on branch v3.9.x (DOC: Add an example for 2D images in 3D plots) -* :ghpull:`28280`: DOC: Add an example for 2D images in 3D plots -* :ghpull:`28278`: Backport PR #28272 on branch v3.9.x (BLD: Move macos builders from 11 to 12) -* :ghpull:`28277`: Backport PR #28274 on branch v3.9.x (ci: Remove deprecated codeql option) -* :ghpull:`28272`: BLD: Move macos builders from 11 to 12 -* :ghpull:`28274`: ci: Remove deprecated codeql option -* :ghpull:`28270`: Backport PR #28269 on branch v3.9.x (Handle GetForegroundWindow() returning NULL.) -* :ghpull:`28269`: Handle GetForegroundWindow() returning NULL. -* :ghpull:`28266`: Backport PR #28257 on branch v3.9.x (Clean up some Meson-related leftovers) -* :ghpull:`28257`: Clean up some Meson-related leftovers -* :ghpull:`28255`: Backport PR #28254 on branch v3.9.x ([DOC] plot type heading consistency) -* :ghpull:`28254`: [DOC] plot type heading consistency -* :ghpull:`28253`: Backport PR #28252 on branch v3.9.x (DOC: Flip the imshow plot types example to match the other examples) -* :ghpull:`28252`: DOC: Flip the imshow plot types example to match the other examples -* :ghpull:`28247`: Backport PR #28230 on branch v3.9.x (Add extra imports to improve typing) -* :ghpull:`28230`: Add extra imports to improve typing -* :ghpull:`28246`: Backport PR #28243 on branch v3.9.x (DOC: Add more 3D plot types) -* :ghpull:`28243`: DOC: Add more 3D plot types -* :ghpull:`28241`: Backport PR #28219 on branch v3.9.x (Bump the actions group with 2 updates) -* :ghpull:`28219`: Bump the actions group with 2 updates -* :ghpull:`28237`: Backport PR #28233 on branch v3.9.x (CI: Fix font install on macOS/Homebrew) -* :ghpull:`28236`: Backport PR #28231 on branch v3.9.x (DOC: we do not need the blit call in on_draw) -* :ghpull:`28233`: CI: Fix font install on macOS/Homebrew -* :ghpull:`28231`: DOC: we do not need the blit call in on_draw +* :ghpull:`28687`: BLD: Include MSVCP140 runtime statically +* :ghpull:`28679`: Run delvewheel with path to required msvcp140.dll +* :ghpull:`28695`: Backport PR #27797 on branch v3.9.x (DOC: Use video files for saving animations) +* :ghpull:`28688`: Backport PR #28293 and #28668: Enable 3.13 wheels and bump cibuildwheel +* :ghpull:`27797`: DOC: Use video files for saving animations +* :ghpull:`28692`: Backport PR #28632 on branch v3.9.x (DOC: Tell sphinx-gallery to link mpl_toolkits from our build) +* :ghpull:`28632`: DOC: Tell sphinx-gallery to link mpl_toolkits from our build +* :ghpull:`28668`: Bump the actions group with 2 updates +* :ghpull:`28686`: Backport PR #28682 on branch v3.9.x (Fix warnings from mingw compilers) +* :ghpull:`28682`: Fix warnings from mingw compilers +* :ghpull:`28676`: Backport PR #28577 on branch v3.9.x (Copy all internals from initial Tick to lazy ones) +* :ghpull:`28577`: Copy all internals from initial Tick to lazy ones +* :ghpull:`28674`: Backport PR #28650 on branch v3.9.x (remove out of date todos on animation.py) +* :ghpull:`28650`: remove out of date todos on animation.py +* :ghpull:`28656`: Backport PR #28649 on branch v3.9.x (FIX: improve formatting of image values in cases of singular norms) +* :ghpull:`28665`: Backport PR #28546 on branch v3.9.x (DOC: Clarify/simplify example of multiple images with one colorbar) +* :ghpull:`28649`: FIX: improve formatting of image values in cases of singular norms +* :ghpull:`28635`: BLD: windows wheels +* :ghpull:`28645`: Backport PR #28644 on branch v3.9.x (DOC: Fix matching for version switcher) +* :ghpull:`28640`: Backport PR #28634 on branch v3.9.x (Closed open div tag in color.ColorMap._repr_html_) +* :ghpull:`28634`: Closed open div tag in color.ColorMap._repr_html_ +* :ghpull:`28636`: Backport PR #28625 on branch v3.9.x (added typing_extensions.Self to _AxesBase.twinx) +* :ghpull:`28625`: added typing_extensions.Self to _AxesBase.twinx +* :ghpull:`28622`: Backport PR #28621 on branch v3.9.x (TYP: Fix a typo in animation.pyi) +* :ghpull:`28621`: TYP: Fix a typo in animation.pyi +* :ghpull:`28605`: Backport PR #28604 on branch v3.9.x (cycler signature update.) +* :ghpull:`28604`: cycler signature update. +* :ghpull:`28598`: Pin PyQt6 back on Ubuntu 20.04 +* :ghpull:`28596`: Backport PR #28518 on branch v3.9.x ([TYP] Fix overload of ``pyplot.subplots``) +* :ghpull:`28518`: [TYP] Fix overload of ``pyplot.subplots`` +* :ghpull:`28591`: Backport PR #28580 on branch v3.9.x (Bump actions/attest-build-provenance from 1.3.2 to 1.3.3 in the actions group) +* :ghpull:`28580`: Bump actions/attest-build-provenance from 1.3.2 to 1.3.3 in the actions group +* :ghpull:`28586`: Backport PR #28582 on branch v3.9.x (FIX: make sticky edge tolerance relative to data range) +* :ghpull:`28582`: FIX: make sticky edge tolerance relative to data range +* :ghpull:`28572`: Backport PR #28571 on branch v3.9.x (DOC: Add version directive to hatch parameter in stackplot) +* :ghpull:`28571`: DOC: Add version directive to hatch parameter in stackplot +* :ghpull:`28564`: Backport PR #28534 on branch v3.9.x ([BLD] Fix WSL build warning) +* :ghpull:`28563`: Backport PR #28526 on branch v3.9.x (Bump pypa/cibuildwheel from 2.19.1 to 2.19.2 in the actions group) +* :ghpull:`28534`: [BLD] Fix WSL build warning +* :ghpull:`28526`: Bump pypa/cibuildwheel from 2.19.1 to 2.19.2 in the actions group +* :ghpull:`28552`: Backport PR #28541 on branch v3.9.x (MNT: be more careful about disk I/O failures when writing font cache) +* :ghpull:`28541`: MNT: be more careful about disk I/O failures when writing font cache +* :ghpull:`28524`: Backport PR #28523 on branch v3.9.x (Fix value error when set widget size to zero while using FigureCanvasQT ) +* :ghpull:`28523`: Fix value error when set widget size to zero while using FigureCanvasQT +* :ghpull:`28519`: Backport PR #28517 on branch v3.9.x (DOC: better cross referencing for animations) -Issues (30): +Issues (9): -* :ghissue:`22482`: [ENH]: pickle (or save) matplotlib figure with insteractive slider -* :ghissue:`25847`: [Bug]: Graph gets cut off with scaled resolution using gtk4cairo backend -* :ghissue:`28341`: [Bug]: Incorrect X-axis scaling with date values -* :ghissue:`28383`: [Bug]: axvspan no longer participating in limit calculations -* :ghissue:`28223`: [Bug]: Inconsistent Visualization of Intervals in ax.barh for Different Duration Widths -* :ghissue:`28432`: [Bug]: Backend name specified as module gets lowercased since 3.9 -* :ghissue:`28467`: [Bug]: Incorrect type stub for ``ErrorbarContainer``'s ``lines`` attribute. -* :ghissue:`28384`: [Bug]: subfigure artists not drawn interactively -* :ghissue:`28234`: [Bug]: mpltype custom role breaks sphinx build for third-party projects that have intersphinx links to matplotlib -* :ghissue:`28464`: [Bug]: figure with subfigures cannot be pickled -* :ghissue:`28448`: [Bug]: Making an RGB image from pickled data throws error -* :ghissue:`23317`: [Bug]: ``add_collection3d`` does not update view limits -* :ghissue:`17130`: autoscale_view is not working with Line3DCollection -* :ghissue:`28434`: [Bug]: Setting exactly 2 colors with tuple in ``plot`` method gives confusing error -* :ghissue:`28417`: [Doc]: axhspan and axvspan now return Rectangles, not Polygons. -* :ghissue:`28378`: [ENH]: Switch text wrapping boundary to subfigure -* :ghissue:`28404`: [Doc]: matplotlib.widgets.CheckButtons no longer has .rectangles attribute, needs removed. -* :ghissue:`28367`: [Bug]: Backend entry points can be erroneously duplicated -* :ghissue:`28358`: [Bug]: Labels don't get wrapped when set_yticks() is used in subplots -* :ghissue:`28374`: [Bug]: rcParam ``tk.window_focus: True`` is causes crash on Linux in version 3.9.0. -* :ghissue:`28324`: [Bug]: show(block=False) freezes -* :ghissue:`28239`: [Doc]: Gallery example showing 3D slice planes -* :ghissue:`27603`: [Bug]: _raw_ticker() istep -* :ghissue:`24328`: [Bug]: class Axes3D.set_box_aspect() sets wrong aspect ratios when Axes3D.view_init( vertical_axis='y') is enabled. -* :ghissue:`28221`: [Doc]: drawedges attribute described twice in matplotlib.colorbar documentation -* :ghissue:`28296`: [Doc]: Missing comma -* :ghissue:`28256`: [Bug]: axes3d.py's _on_move() converts the roll angle to radians, but then passes it to view_init() as if it were still in degrees -* :ghissue:`28267`: [Bug]: for Python 3.11.9 gor error ValueError: PyCapsule_New called with null pointer -* :ghissue:`28022`: [Bug]: Type of Axes is unknown pyright -* :ghissue:`28002`: Segfault from path editor example with QtAgg +* :ghissue:`28551`: [Bug]: Possible issue with Matplotlib 3.9.1 wheel on Windows only +* :ghissue:`28250`: [Doc]: Sphinx gallery links mispointed for Axes3D methods +* :ghissue:`28574`: [Bug]: Nondeterministic behavior with subplot spacing and constrained layout +* :ghissue:`28626`: [Doc]: Remove old TODO's from animation.py +* :ghissue:`28648`: [Bug]: format_image_data on an image of only zeros produses a large number of zeros +* :ghissue:`28624`: [Bug]: Bad type hint in ``_AxesBase.twinx()`` +* :ghissue:`28567`: [Bug]: sticky edge related changes for datetime plots +* :ghissue:`28533`: [Doc]: Stackplot hatch functionality has version dependencies +* :ghissue:`28538`: [Bug]: Permission denied when importing matplotlib.pyplot Previous GitHub statistics diff --git a/doc/users/prev_whats_new/github_stats_3.9.1.rst b/doc/users/prev_whats_new/github_stats_3.9.1.rst new file mode 100644 index 000000000000..1bd7860546cb --- /dev/null +++ b/doc/users/prev_whats_new/github_stats_3.9.1.rst @@ -0,0 +1,192 @@ +.. _github-stats-3-9-1: + +GitHub statistics for 3.9.1 (Jul 04, 2024) +========================================== + +GitHub statistics for 2024/05/15 (tag: v3.9.0) - 2024/07/04 + +These lists are automatically generated, and may be incomplete or contain duplicates. + +We closed 30 issues and merged 111 pull requests. +The full list can be seen `on GitHub `__ + +The following 29 authors contributed 184 commits. + +* Antony Lee +* Brigitta Sipőcz +* Christian Mattsson +* dale +* dependabot[bot] +* Elliott Sales de Andrade +* Eytan Adler +* Greg Lucas +* haaris +* hannah +* Ian Thomas +* Illviljan +* K900 +* Kyle Sunden +* Lumberbot (aka Jack) +* malhar2460 +* Matthew Feickert +* Melissa Weber Mendonça +* MischaMegens2 +* Oscar Gustafsson +* Ruth Comer +* Scott Shambaugh +* simond07 +* SjoerdB93 +* Takumasa N +* Takumasa N. +* Takumasa Nakamura +* Thomas A Caswell +* Tim Hoffmann + +GitHub issues and pull requests: + +Pull Requests (111): + +* :ghpull:`28507`: Backport PR #28430 on branch v3.9.x (Fix pickling of AxesWidgets.) +* :ghpull:`28506`: Backport PR #28451 on branch v3.9.x (Fix GTK cairo backends) +* :ghpull:`28430`: Fix pickling of AxesWidgets. +* :ghpull:`25861`: Fix Hidpi scaling for GTK4Cairo +* :ghpull:`28451`: Fix GTK cairo backends +* :ghpull:`28499`: Backport PR #28498 on branch v3.9.x (Don't fail if we can't query system fonts on macOS) +* :ghpull:`28498`: Don't fail if we can't query system fonts on macOS +* :ghpull:`28491`: Backport PR #28487 on branch v3.9.x (Fix autoscaling with axhspan) +* :ghpull:`28490`: Backport PR #28486 on branch v3.9.x (Fix CompositeGenericTransform.contains_branch_seperately) +* :ghpull:`28487`: Fix autoscaling with axhspan +* :ghpull:`28486`: Fix CompositeGenericTransform.contains_branch_seperately +* :ghpull:`28483`: Backport PR #28393 on branch v3.9.x (Make sticky edges only apply if the sticky edge is the most extreme limit point) +* :ghpull:`28482`: Backport PR #28473 on branch v3.9.x (Do not lowercase module:// backends) +* :ghpull:`28393`: Make sticky edges only apply if the sticky edge is the most extreme limit point +* :ghpull:`28473`: Do not lowercase module:// backends +* :ghpull:`28480`: Backport PR #28474 on branch v3.9.x (Fix typing and docs for containers) +* :ghpull:`28479`: Backport PR #28397 (FIX: stale root Figure when adding/updating subfigures) +* :ghpull:`28474`: Fix typing and docs for containers +* :ghpull:`28472`: Backport PR #28289 on branch v3.9.x (Promote mpltype Sphinx role to a public extension) +* :ghpull:`28471`: Backport PR #28342 on branch v3.9.x (DOC: Document the parameter *position* of apply_aspect() as internal) +* :ghpull:`28470`: Backport PR #28398 on branch v3.9.x (Add GIL Release to flush_events in macosx backend) +* :ghpull:`28469`: Backport PR #28355 on branch v3.9.x (MNT: Re-add matplotlib.cm.get_cmap) +* :ghpull:`28397`: FIX: stale root Figure when adding/updating subfigures +* :ghpull:`28289`: Promote mpltype Sphinx role to a public extension +* :ghpull:`28342`: DOC: Document the parameter *position* of apply_aspect() as internal +* :ghpull:`28398`: Add GIL Release to flush_events in macosx backend +* :ghpull:`28355`: MNT: Re-add matplotlib.cm.get_cmap +* :ghpull:`28468`: Backport PR #28465 on branch v3.9.x (Fix pickling of SubFigures) +* :ghpull:`28465`: Fix pickling of SubFigures +* :ghpull:`28462`: Backport PR #28440 on branch v3.9.x (DOC: Add note about simplification of to_polygons) +* :ghpull:`28460`: Backport PR #28459 on branch v3.9.x (DOC: Document kwargs scope for tick setter functions) +* :ghpull:`28461`: Backport PR #28458 on branch v3.9.x (Correct numpy dtype comparisons in image_resample) +* :ghpull:`28440`: DOC: Add note about simplification of to_polygons +* :ghpull:`28458`: Correct numpy dtype comparisons in image_resample +* :ghpull:`28459`: DOC: Document kwargs scope for tick setter functions +* :ghpull:`28450`: Backport of 28371 and 28411 +* :ghpull:`28446`: Backport PR #28403 on branch v3.9.x (FIX: Autoscale support in add_collection3d for Line3DCollection and Poly3DCollection +* :ghpull:`28445`: Backport PR #28403 on branch v3.9.x (FIX: Autoscale support in add_collection3d for Line3DCollection and Poly3DCollection) +* :ghpull:`28438`: Backport PR #28436 on branch v3.9.x (Fix ``is_color_like`` for 2-tuple of strings and fix ``to_rgba`` for ``(nth_color, alpha)``) +* :ghpull:`28403`: FIX: Autoscale support in add_collection3d for Line3DCollection and Poly3DCollection +* :ghpull:`28443`: Backport PR #28441 on branch v3.9.x (MNT: Update basic units example to work with numpy 2.0) +* :ghpull:`28441`: MNT: Update basic units example to work with numpy 2.0 +* :ghpull:`28436`: Fix ``is_color_like`` for 2-tuple of strings and fix ``to_rgba`` for ``(nth_color, alpha)`` +* :ghpull:`28426`: Backport PR #28425 on branch v3.9.x (Fix Circle yaml line length) +* :ghpull:`28427`: Fix circleci yaml +* :ghpull:`28425`: Fix Circle yaml line length +* :ghpull:`28422`: Backport PR #28401 on branch v3.9.x (FIX: Fix text wrapping) +* :ghpull:`28424`: Backport PR #28423 on branch v3.9.x (Update return type for Axes.axhspan and Axes.axvspan) +* :ghpull:`28423`: Update return type for Axes.axhspan and Axes.axvspan +* :ghpull:`28401`: FIX: Fix text wrapping +* :ghpull:`28419`: Backport PR #28414 on branch v3.9.x (Clean up obsolete widget code) +* :ghpull:`28411`: Bump the actions group with 3 updates +* :ghpull:`28414`: Clean up obsolete widget code +* :ghpull:`28415`: Backport PR #28413 on branch v3.9.x (CI: update action that got moved org) +* :ghpull:`28413`: CI: update action that got moved org +* :ghpull:`28392`: Backport PR #28388 on branch v3.9.x (Allow duplicate (name, value) entry points for backends) +* :ghpull:`28362`: Backport PR #28337 on branch v3.9.x (Bump the actions group across 1 directory with 3 updates) +* :ghpull:`28388`: Allow duplicate (name, value) entry points for backends +* :ghpull:`28389`: Backport PR #28380 on branch v3.9.x (Remove outdated docstring section in RendererBase.draw_text.) +* :ghpull:`28380`: Remove outdated docstring section in RendererBase.draw_text. +* :ghpull:`28385`: Backport PR #28377 on branch v3.9.x (DOC: Clarify scope of wrap.) +* :ghpull:`28377`: DOC: Clarify scope of wrap. +* :ghpull:`28368`: Backport PR #28359 on branch v3.9.x (Document that axes unsharing is impossible.) +* :ghpull:`28359`: Document that axes unsharing is impossible. +* :ghpull:`28337`: Bump the actions group across 1 directory with 3 updates +* :ghpull:`28351`: Backport PR #28307 on branch v3.9.x (DOC: New color line by value example) +* :ghpull:`28307`: DOC: New color line by value example +* :ghpull:`28339`: Backport PR #28336 on branch v3.9.x (DOC: Add version warning banner for docs versions different from stable) +* :ghpull:`28336`: DOC: Add version warning banner for docs versions different from stable +* :ghpull:`28334`: Backport PR #28332 on branch v3.9.x (Call IPython.enable_gui when install repl displayhook) +* :ghpull:`28332`: Call IPython.enable_gui when install repl displayhook +* :ghpull:`28331`: Backport PR #28329 on branch v3.9.x (DOC: Add example for 3D intersecting planes) +* :ghpull:`28329`: DOC: Add example for 3D intersecting planes +* :ghpull:`28327`: Backport PR #28292 on branch v3.9.x (Resolve MaxNLocator IndexError when no large steps) +* :ghpull:`28292`: Resolve MaxNLocator IndexError when no large steps +* :ghpull:`28326`: Backport PR #28041 on branch v3.9.x ([BUG]: Shift box_aspect according to vertical_axis) +* :ghpull:`28041`: [BUG]: Shift box_aspect according to vertical_axis +* :ghpull:`28320`: Backport PR #27001 on branch v3.9.x ([TYP] Add overload of ``pyplot.subplots``) +* :ghpull:`27001`: [TYP] Add overload of ``pyplot.subplots`` +* :ghpull:`28318`: Backport PR #28273 on branch v3.9.x (CI: Add GitHub artifact attestations to package distribution) +* :ghpull:`28273`: CI: Add GitHub artifact attestations to package distribution +* :ghpull:`28305`: Backport PR #28303 on branch v3.9.x (Removed drawedges repeated definition from function doc string) +* :ghpull:`28303`: Removed drawedges repeated definition from function doc string +* :ghpull:`28299`: Backport PR #28297 on branch v3.9.x (Solved #28296 Added missing comma) +* :ghpull:`28297`: Solved #28296 Added missing comma +* :ghpull:`28294`: Backport PR #28261 on branch v3.9.x (Correct roll angle units, issue #28256) +* :ghpull:`28261`: Correct roll angle units, issue #28256 +* :ghpull:`28283`: Backport PR #28280 on branch v3.9.x (DOC: Add an example for 2D images in 3D plots) +* :ghpull:`28280`: DOC: Add an example for 2D images in 3D plots +* :ghpull:`28278`: Backport PR #28272 on branch v3.9.x (BLD: Move macos builders from 11 to 12) +* :ghpull:`28277`: Backport PR #28274 on branch v3.9.x (ci: Remove deprecated codeql option) +* :ghpull:`28272`: BLD: Move macos builders from 11 to 12 +* :ghpull:`28274`: ci: Remove deprecated codeql option +* :ghpull:`28270`: Backport PR #28269 on branch v3.9.x (Handle GetForegroundWindow() returning NULL.) +* :ghpull:`28269`: Handle GetForegroundWindow() returning NULL. +* :ghpull:`28266`: Backport PR #28257 on branch v3.9.x (Clean up some Meson-related leftovers) +* :ghpull:`28257`: Clean up some Meson-related leftovers +* :ghpull:`28255`: Backport PR #28254 on branch v3.9.x ([DOC] plot type heading consistency) +* :ghpull:`28254`: [DOC] plot type heading consistency +* :ghpull:`28253`: Backport PR #28252 on branch v3.9.x (DOC: Flip the imshow plot types example to match the other examples) +* :ghpull:`28252`: DOC: Flip the imshow plot types example to match the other examples +* :ghpull:`28247`: Backport PR #28230 on branch v3.9.x (Add extra imports to improve typing) +* :ghpull:`28230`: Add extra imports to improve typing +* :ghpull:`28246`: Backport PR #28243 on branch v3.9.x (DOC: Add more 3D plot types) +* :ghpull:`28243`: DOC: Add more 3D plot types +* :ghpull:`28241`: Backport PR #28219 on branch v3.9.x (Bump the actions group with 2 updates) +* :ghpull:`28219`: Bump the actions group with 2 updates +* :ghpull:`28237`: Backport PR #28233 on branch v3.9.x (CI: Fix font install on macOS/Homebrew) +* :ghpull:`28236`: Backport PR #28231 on branch v3.9.x (DOC: we do not need the blit call in on_draw) +* :ghpull:`28233`: CI: Fix font install on macOS/Homebrew +* :ghpull:`28231`: DOC: we do not need the blit call in on_draw + +Issues (30): + +* :ghissue:`22482`: [ENH]: pickle (or save) matplotlib figure with insteractive slider +* :ghissue:`25847`: [Bug]: Graph gets cut off with scaled resolution using gtk4cairo backend +* :ghissue:`28341`: [Bug]: Incorrect X-axis scaling with date values +* :ghissue:`28383`: [Bug]: axvspan no longer participating in limit calculations +* :ghissue:`28223`: [Bug]: Inconsistent Visualization of Intervals in ax.barh for Different Duration Widths +* :ghissue:`28432`: [Bug]: Backend name specified as module gets lowercased since 3.9 +* :ghissue:`28467`: [Bug]: Incorrect type stub for ``ErrorbarContainer``'s ``lines`` attribute. +* :ghissue:`28384`: [Bug]: subfigure artists not drawn interactively +* :ghissue:`28234`: [Bug]: mpltype custom role breaks sphinx build for third-party projects that have intersphinx links to matplotlib +* :ghissue:`28464`: [Bug]: figure with subfigures cannot be pickled +* :ghissue:`28448`: [Bug]: Making an RGB image from pickled data throws error +* :ghissue:`23317`: [Bug]: ``add_collection3d`` does not update view limits +* :ghissue:`17130`: autoscale_view is not working with Line3DCollection +* :ghissue:`28434`: [Bug]: Setting exactly 2 colors with tuple in ``plot`` method gives confusing error +* :ghissue:`28417`: [Doc]: axhspan and axvspan now return Rectangles, not Polygons. +* :ghissue:`28378`: [ENH]: Switch text wrapping boundary to subfigure +* :ghissue:`28404`: [Doc]: matplotlib.widgets.CheckButtons no longer has .rectangles attribute, needs removed. +* :ghissue:`28367`: [Bug]: Backend entry points can be erroneously duplicated +* :ghissue:`28358`: [Bug]: Labels don't get wrapped when set_yticks() is used in subplots +* :ghissue:`28374`: [Bug]: rcParam ``tk.window_focus: True`` is causes crash on Linux in version 3.9.0. +* :ghissue:`28324`: [Bug]: show(block=False) freezes +* :ghissue:`28239`: [Doc]: Gallery example showing 3D slice planes +* :ghissue:`27603`: [Bug]: _raw_ticker() istep +* :ghissue:`24328`: [Bug]: class Axes3D.set_box_aspect() sets wrong aspect ratios when Axes3D.view_init( vertical_axis='y') is enabled. +* :ghissue:`28221`: [Doc]: drawedges attribute described twice in matplotlib.colorbar documentation +* :ghissue:`28296`: [Doc]: Missing comma +* :ghissue:`28256`: [Bug]: axes3d.py's _on_move() converts the roll angle to radians, but then passes it to view_init() as if it were still in degrees +* :ghissue:`28267`: [Bug]: for Python 3.11.9 gor ValueError: PyCapsule_New called with null pointer +* :ghissue:`28022`: [Bug]: Type of Axes is unknown pyright +* :ghissue:`28002`: Segfault from path editor example with QtAgg diff --git a/doc/users/release_notes.rst b/doc/users/release_notes.rst index 1204450f6c05..74bc0f13bf1f 100644 --- a/doc/users/release_notes.rst +++ b/doc/users/release_notes.rst @@ -19,9 +19,11 @@ Version 3.9 :maxdepth: 1 prev_whats_new/whats_new_3.9.0.rst + ../api/prev_api_changes/api_changes_3.9.2.rst ../api/prev_api_changes/api_changes_3.9.1.rst ../api/prev_api_changes/api_changes_3.9.0.rst github_stats.rst + prev_whats_new/github_stats_3.9.1.rst prev_whats_new/github_stats_3.9.0.rst Version 3.8 From a254b687df97cda8c6affa37a1dfcf213f8e6c3a Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 12 Aug 2024 19:35:24 -0400 Subject: [PATCH 29/37] REL: 3.9.2 This is the second bugfix release of the 3.9.x series. This release contains several bug-fixes and adjustments: - Be more resilient to I/O failures when writing font cache - Fix nondeterministic behavior with subplot spacing and constrained layout - Fix sticky edge tolerance relative to data range - Improve formatting of image values in cases of singular norms Windows wheels now bundle the MSVC runtime DLL statically to avoid inconsistencies with other wheels and random crashes depending on import order. From 4b30b1d938b1ccad1e96b35ec11292e9fb8f05fd Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 12 Aug 2024 19:52:20 -0400 Subject: [PATCH 30/37] BLD: bump branch away from tag So the tarballs from GitHub are stable. From 3aea791026cabe9b9bdaba6d9a23c122bbf04115 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 12 Aug 2024 20:13:22 -0400 Subject: [PATCH 31/37] DOC: Add Zenodo DOI for 3.9.2 --- doc/_static/zenodo_cache/13308876.svg | 35 +++++++++++++++++++++++++++ doc/project/citing.rst | 3 +++ tools/cache_zenodo_svg.py | 1 + 3 files changed, 39 insertions(+) create mode 100644 doc/_static/zenodo_cache/13308876.svg diff --git a/doc/_static/zenodo_cache/13308876.svg b/doc/_static/zenodo_cache/13308876.svg new file mode 100644 index 000000000000..749bc3c19026 --- /dev/null +++ b/doc/_static/zenodo_cache/13308876.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + DOI + + + DOI + + + 10.5281/zenodo.13308876 + + + 10.5281/zenodo.13308876 + + + \ No newline at end of file diff --git a/doc/project/citing.rst b/doc/project/citing.rst index e0b99995ad11..38c989fca195 100644 --- a/doc/project/citing.rst +++ b/doc/project/citing.rst @@ -32,6 +32,9 @@ By version .. START OF AUTOGENERATED +v3.9.2 + .. image:: ../_static/zenodo_cache/13308876.svg + :target: https://doi.org/10.5281/zenodo.13308876 v3.9.1 .. image:: ../_static/zenodo_cache/12652732.svg :target: https://doi.org/10.5281/zenodo.12652732 diff --git a/tools/cache_zenodo_svg.py b/tools/cache_zenodo_svg.py index 1dc2fbba020b..40814d21573c 100644 --- a/tools/cache_zenodo_svg.py +++ b/tools/cache_zenodo_svg.py @@ -63,6 +63,7 @@ def _get_xdg_cache_dir(): if __name__ == "__main__": data = { + "v3.9.2": "13308876", "v3.9.1": "12652732", "v3.9.0": "11201097", "v3.8.4": "10916799", From d04b2f64fe2fdc3f83707229d64d1516bb56405d Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 12 Aug 2024 21:55:17 -0400 Subject: [PATCH 32/37] DOC: Fix a typo in GitHub stats --- doc/users/github_stats.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/users/github_stats.rst b/doc/users/github_stats.rst index 00c3e5d656a1..d357a6759d30 100644 --- a/doc/users/github_stats.rst +++ b/doc/users/github_stats.rst @@ -89,7 +89,7 @@ Issues (9): * :ghissue:`28250`: [Doc]: Sphinx gallery links mispointed for Axes3D methods * :ghissue:`28574`: [Bug]: Nondeterministic behavior with subplot spacing and constrained layout * :ghissue:`28626`: [Doc]: Remove old TODO's from animation.py -* :ghissue:`28648`: [Bug]: format_image_data on an image of only zeros produses a large number of zeros +* :ghissue:`28648`: [Bug]: format_image_data on an image of only zeros produces a large number of zeros * :ghissue:`28624`: [Bug]: Bad type hint in ``_AxesBase.twinx()`` * :ghissue:`28567`: [Bug]: sticky edge related changes for datetime plots * :ghissue:`28533`: [Doc]: Stackplot hatch functionality has version dependencies From b7fc61e3edf6a4a4ce7ea2ea5b26f3df56c36182 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 13 Aug 2024 04:18:45 -0400 Subject: [PATCH 33/37] DOC: Mark 3.9.2 as the stable version --- doc/_static/switcher.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/_static/switcher.json b/doc/_static/switcher.json index 1ceeb2c259cc..5a48ec138f4d 100644 --- a/doc/_static/switcher.json +++ b/doc/_static/switcher.json @@ -1,7 +1,7 @@ [ { "name": "3.9 (stable)", - "version": "3.9.1", + "version": "3.9.2", "url": "https://matplotlib.org/stable/", "preferred": true }, From 7ac8eee0c17855e1b4a7b4cd72019c71a76542a5 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 14 Aug 2024 16:06:02 -0400 Subject: [PATCH 34/37] ci: Skip GTK4 on macOS 12 temporarily This causes homebrew to update Python, but because the image is outdated, this causes conflicts. --- .github/workflows/tests.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c27b09f1ad5..1f15607df709 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -158,7 +158,12 @@ jobs: ;; macOS) brew update - brew install ccache ghostscript gobject-introspection gtk4 ninja + brew install ccache ghostscript ninja + # The macOS 12 images have an older Python, and this causes homebrew to generate conflicts. + # We'll just skip GTK for now, to not pull in Python updates. + if [[ "${{ matrix.os }}" = macos-14 ]]; then + brew install gobject-introspection gtk4 + fi brew install --cask font-noto-sans-cjk inkscape ;; esac From 9c88d13af664bcdc28bab3234172435629689f20 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 14 Aug 2024 16:44:38 -0400 Subject: [PATCH 35/37] TST: Guard against PyGObject existing, but not gobject-introspection --- lib/matplotlib/tests/test_backends_interactive.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index d624b5db0ac2..2c6b61a48438 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -81,10 +81,18 @@ def _get_available_interactive_backends(): elif env["MPLBACKEND"] == 'macosx' and os.environ.get('TF_BUILD'): reason = "macosx backend fails on Azure" elif env["MPLBACKEND"].startswith('gtk'): - import gi # type: ignore + try: + import gi # type: ignore + except ImportError: + # Though we check that `gi` exists above, it is possible that its + # C-level dependencies are not available, and then it still raises an + # `ImportError`, so guard against that. + available_gtk_versions = [] + else: + gi_repo = gi.Repository.get_default() + available_gtk_versions = gi_repo.enumerate_versions('Gtk') version = env["MPLBACKEND"][3] - repo = gi.Repository.get_default() - if f'{version}.0' not in repo.enumerate_versions('Gtk'): + if f'{version}.0' not in available_gtk_versions: reason = "no usable GTK bindings" marks = [] if reason: From 4047b5ea85e3bff6b6f88e224066bfe991f2b5a5 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 14 Aug 2024 16:58:08 -0400 Subject: [PATCH 36/37] ci: Disable eager upgrades from Homebrew GitHub and Azure's images install a pre-existing Python, which Homebrew attempts to upgrade if any of the packages we want to install depend on it. Unfortunately, this may cause conflicts on Python's symlinks, so stop Homebrew from trying to do an automatic upgrade. --- .github/workflows/tests.yml | 1 + azure-pipelines.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1f15607df709..0c71577c0875 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -158,6 +158,7 @@ jobs: ;; macOS) brew update + export HOMEBREW_NO_INSTALL_UPGRADE=1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install ccache ghostscript ninja # The macOS 12 images have an older Python, and this causes homebrew to generate conflicts. # We'll just skip GTK for now, to not pull in Python updates. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 35c95c3b1f94..7919e9512f48 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -111,6 +111,7 @@ stages: ;; Darwin) brew update + export HOMEBREW_NO_INSTALL_UPGRADE=1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --cask xquartz brew install ccache ffmpeg imagemagick mplayer ninja pkg-config brew install --cask font-noto-sans-cjk-sc From 36c04a41a29e1470f7004fa0f8c8e741e7d5d8be Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 14 Aug 2024 17:02:23 -0400 Subject: [PATCH 37/37] BLD: Avoid pybind11 2.13.3 due to Windows quoting bug See https://github.com/pybind/pybind11/issues/5300#issuecomment-2287698500 --- pyproject.toml | 4 ++-- requirements/dev/build-requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0f181ccb629e..b706d86cb7b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ requires-python = ">=3.10" dev = [ "meson-python>=0.13.1", "numpy>=1.25", - "pybind11>=2.6", + "pybind11>=2.6,!=2.13.3", "setuptools_scm>=7", # Not required by us but setuptools_scm without a version, cso _if_ # installed, then setuptools_scm 8 requires at least this version. @@ -71,7 +71,7 @@ build-backend = "mesonpy" # Also keep in sync with optional dependencies above. requires = [ "meson-python>=0.13.1", - "pybind11>=2.6", + "pybind11>=2.6,!=2.13.3", "setuptools_scm>=7", # Comments on numpy build requirement range: diff --git a/requirements/dev/build-requirements.txt b/requirements/dev/build-requirements.txt index 1b22d228e217..6f0c6029f4a2 100644 --- a/requirements/dev/build-requirements.txt +++ b/requirements/dev/build-requirements.txt @@ -1,4 +1,4 @@ -pybind11 +pybind11!=2.13.3 meson-python numpy setuptools-scm