Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 756cd29

Browse filesBrowse files
authored
Merge branch 'matplotlib:main' into livia
2 parents 5b9ebab + def8fa4 commit 756cd29
Copy full SHA for 756cd29

File tree

113 files changed

+1182
-828
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

113 files changed

+1182
-828
lines changed

‎.github/workflows/cibuildwheel.yml

Copy file name to clipboardExpand all lines: .github/workflows/cibuildwheel.yml
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
fetch-depth: 0
4545
persist-credentials: false
4646

47-
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
47+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
4848
name: Install Python
4949
with:
5050
python-version: '3.11'
@@ -131,13 +131,13 @@ jobs:
131131

132132
steps:
133133
- name: Download sdist
134-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
134+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
135135
with:
136136
name: cibw-sdist
137137
path: dist/
138138

139139
- name: Build wheels for CPython 3.13
140-
uses: pypa/cibuildwheel@d04cacbc9866d432033b1d09142936e6a0e2121a # v2.23.2
140+
uses: pypa/cibuildwheel@faf86a6ed7efa889faf6996aa23820831055001a # v2.23.3
141141
with:
142142
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
143143
env:
@@ -148,15 +148,15 @@ jobs:
148148
CIBW_ARCHS: ${{ matrix.cibw_archs }}
149149

150150
- name: Build wheels for CPython 3.12
151-
uses: pypa/cibuildwheel@d04cacbc9866d432033b1d09142936e6a0e2121a # v2.23.2
151+
uses: pypa/cibuildwheel@faf86a6ed7efa889faf6996aa23820831055001a # v2.23.3
152152
with:
153153
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
154154
env:
155155
CIBW_BUILD: "cp312-*"
156156
CIBW_ARCHS: ${{ matrix.cibw_archs }}
157157

158158
- name: Build wheels for CPython 3.11
159-
uses: pypa/cibuildwheel@d04cacbc9866d432033b1d09142936e6a0e2121a # v2.23.2
159+
uses: pypa/cibuildwheel@faf86a6ed7efa889faf6996aa23820831055001a # v2.23.3
160160
with:
161161
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
162162
env:
@@ -165,7 +165,7 @@ jobs:
165165

166166

167167
- name: Build wheels for PyPy
168-
uses: pypa/cibuildwheel@d04cacbc9866d432033b1d09142936e6a0e2121a # v2.23.2
168+
uses: pypa/cibuildwheel@faf86a6ed7efa889faf6996aa23820831055001a # v2.23.3
169169
with:
170170
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
171171
env:
@@ -194,7 +194,7 @@ jobs:
194194
contents: read
195195
steps:
196196
- name: Download packages
197-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
197+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
198198
with:
199199
pattern: cibw-*
200200
path: dist
@@ -204,7 +204,7 @@ jobs:
204204
run: ls dist
205205

206206
- name: Generate artifact attestation for sdist and wheel
207-
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
207+
uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0
208208
with:
209209
subject-path: dist/matplotlib-*
210210

‎.github/workflows/codeql-analysis.yml

Copy file name to clipboardExpand all lines: .github/workflows/codeql-analysis.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
persist-credentials: false
3232

3333
- name: Initialize CodeQL
34-
uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
34+
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
3535
with:
3636
languages: ${{ matrix.language }}
3737

@@ -42,4 +42,4 @@ jobs:
4242
pip install --user -v .
4343
4444
- name: Perform CodeQL Analysis
45-
uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
45+
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18

‎.github/workflows/mypy-stubtest.yml

Copy file name to clipboardExpand all lines: .github/workflows/mypy-stubtest.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
persist-credentials: false
1818

1919
- name: Set up Python 3
20-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
20+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2121
with:
2222
python-version: '3.11'
2323

‎.github/workflows/reviewdog.yml

Copy file name to clipboardExpand all lines: .github/workflows/reviewdog.yml
+16-2Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ permissions:
66
contents: read
77

88
jobs:
9+
pre-commit:
10+
name: precommit
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14+
with:
15+
fetch-depth: 0
16+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
17+
with:
18+
python-version: "3.x"
19+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
20+
with:
21+
extra_args: --hook-stage manual --all-files
22+
923
ruff:
1024
name: ruff
1125
runs-on: ubuntu-latest
@@ -17,7 +31,7 @@ jobs:
1731
persist-credentials: false
1832

1933
- name: Set up Python 3
20-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
34+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2135
with:
2236
python-version: '3.11'
2337

@@ -46,7 +60,7 @@ jobs:
4660
persist-credentials: false
4761

4862
- name: Set up Python 3
49-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
63+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
5064
with:
5165
python-version: '3.11'
5266

‎.github/workflows/tests.yml

Copy file name to clipboardExpand all lines: .github/workflows/tests.yml
+12-2Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,27 @@ jobs:
5252
python-version: '3.11'
5353
extra-requirements: '-c requirements/testing/minver.txt'
5454
delete-font-cache: true
55+
# https://github.com/matplotlib/matplotlib/issues/29844
56+
pygobject-ver: '<3.52.0'
5557
- os: ubuntu-22.04
5658
python-version: '3.11'
5759
CFLAGS: "-fno-lto" # Ensure that disabling LTO works.
5860
extra-requirements: '-r requirements/testing/extra.txt'
61+
# https://github.com/matplotlib/matplotlib/issues/29844
62+
pygobject-ver: '<3.52.0'
5963
- os: ubuntu-22.04-arm
6064
python-version: '3.12'
65+
# https://github.com/matplotlib/matplotlib/issues/29844
66+
pygobject-ver: '<3.52.0'
6167
- os: ubuntu-22.04
6268
python-version: '3.13'
69+
# https://github.com/matplotlib/matplotlib/issues/29844
70+
pygobject-ver: '<3.52.0'
6371
- name-suffix: "Free-threaded"
6472
os: ubuntu-22.04
6573
python-version: '3.13t'
74+
# https://github.com/matplotlib/matplotlib/issues/29844
75+
pygobject-ver: '<3.52.0'
6676
- os: ubuntu-24.04
6777
python-version: '3.12'
6878
- os: macos-13 # This runner is on Intel chips.
@@ -84,7 +94,7 @@ jobs:
8494
persist-credentials: false
8595

8696
- name: Set up Python ${{ matrix.python-version }}
87-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
97+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
8898
with:
8999
python-version: ${{ matrix.python-version }}
90100
allow-prereleases: true
@@ -386,7 +396,7 @@ jobs:
386396
fi
387397
- name: Upload code coverage
388398
if: ${{ !cancelled() && github.event_name != 'schedule' }}
389-
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
399+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
390400
with:
391401
name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }}"
392402
token: ${{ secrets.CODECOV_TOKEN }}

‎.pre-commit-config.yaml

Copy file name to clipboardExpand all lines: .pre-commit-config.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ exclude: |
1010
doc/devel/gitwash|
1111
doc/users/prev|
1212
doc/api/prev|
13-
lib/matplotlib/tests/tinypages
13+
lib/matplotlib/tests/data/tinypages
1414
)
1515
repos:
1616
- repo: https://github.com/pre-commit/pre-commit-hooks

‎azure-pipelines.yml

Copy file name to clipboardExpand all lines: azure-pipelines.yml
+18-45Lines changed: 18 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ stages:
5050
strategy:
5151
matrix:
5252
Windows_py311:
53-
vmImage: 'windows-2019' # keep one job pinned to the oldest image
53+
vmImage: 'windows-2022' # Keep one job pinned to the oldest image
5454
python.version: '3.11'
5555
Windows_py312:
5656
vmImage: 'windows-latest'
@@ -101,50 +101,23 @@ stages:
101101
VS=$(ls -d /c/Program\ Files*/Microsoft\ Visual\ Studio/*/Enterprise)
102102
echo "Visual Studio: ${VS}"
103103
DIR="$VS/Common7/IDE/Extensions/Microsoft/CodeCoverage.Console"
104-
if [[ -d $DIR ]]; then
105-
# This is for MSVC 2022 (on windows-latest).
106-
TOOL="$DIR/Microsoft.CodeCoverage.Console.exe"
107-
for f in build/cp*/src/*.pyd; do
108-
echo $f
109-
echo "=============================="
110-
"$TOOL" instrument $f --session-id $SESSION_ID \
111-
--log-level Verbose --log-file instrument.log
112-
cat instrument.log
113-
rm instrument.log
114-
done
115-
echo "Starting $TOOL in server mode"
116-
"$TOOL" collect \
117-
--session-id $SESSION_ID --server-mode \
118-
--output-format cobertura --output extensions.xml \
119-
--log-level Verbose --log-file extensions.log &
120-
VS_VER=2022
121-
else
122-
DIR="$VS"/Team\ Tools/Dynamic\ Code\ Coverage\ Tools/amd64
123-
if [[ -d $DIR ]]; then
124-
# This is for MSVC 2019 (on windows-2019).
125-
VSINSTR="$VS"/Team\ Tools/Performance\ Tools/vsinstr.exe
126-
for f in build/cp*/src/*.pyd; do
127-
"$VSINSTR" $f -Verbose -Coverage
128-
done
129-
TOOL="$DIR/CodeCoverage.exe"
130-
cat > extensions.config << EOF
131-
<CodeCoverage>
132-
<CollectFromChildProcesses>true</CollectFromChildProcesses>
133-
<ModulePaths>
134-
<Include>
135-
<ModulePath>.*\\.*\.pyd</ModulePath>
136-
</Include>
137-
</ModulePaths>
138-
</CodeCoverage>
139-
EOF
140-
echo "Starting $TOOL in server mode"
141-
"$TOOL" collect \
142-
-config:extensions.config -session:$SESSION_ID \
143-
-output:extensions.coverage -verbose &
144-
echo "Started $TOOL"
145-
VS_VER=2019
146-
fi
147-
fi
104+
# This is for MSVC 2022 (on windows-latest).
105+
TOOL="$DIR/Microsoft.CodeCoverage.Console.exe"
106+
for f in build/cp*/src/*.pyd; do
107+
echo $f
108+
echo "=============================="
109+
"$TOOL" instrument $f --session-id $SESSION_ID \
110+
--log-level Verbose --log-file instrument.log
111+
cat instrument.log
112+
rm instrument.log
113+
done
114+
echo "Starting $TOOL in server mode"
115+
"$TOOL" collect \
116+
--session-id $SESSION_ID --server-mode \
117+
--output-format cobertura --output extensions.xml \
118+
--log-level Verbose --log-file extensions.log &
119+
VS_VER=2022
120+
148121
echo "##vso[task.setvariable variable=VS_COVERAGE_TOOL]$TOOL"
149122
150123
PYTHONFAULTHANDLER=1 pytest -rfEsXR -n 2 \
+22-16Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
11
import matplotlib.pyplot as plt
22

33

4-
def arrow(p1, p2, **props):
5-
axs[0, 0].annotate(
6-
"", p1, p2, xycoords='figure fraction',
7-
arrowprops=dict(arrowstyle="<->", shrinkA=0, shrinkB=0, **props))
8-
9-
104
fig, axs = plt.subplots(2, 2, figsize=(6.5, 4))
115
fig.set_facecolor('lightblue')
126
fig.subplots_adjust(0.1, 0.1, 0.9, 0.9, 0.4, 0.4)
7+
8+
overlay = fig.add_axes([0, 0, 1, 1], zorder=100)
9+
overlay.axis("off")
10+
xycoords='figure fraction'
11+
arrowprops=dict(arrowstyle="<->", shrinkA=0, shrinkB=0)
12+
1313
for ax in axs.flat:
1414
ax.set(xticks=[], yticks=[])
1515

16-
arrow((0, 0.75), (0.1, 0.75)) # left
17-
arrow((0.435, 0.75), (0.565, 0.75)) # wspace
18-
arrow((0.9, 0.75), (1, 0.75)) # right
16+
overlay.annotate("", (0, 0.75), (0.1, 0.75),
17+
xycoords=xycoords, arrowprops=arrowprops) # left
18+
overlay.annotate("", (0.435, 0.25), (0.565, 0.25),
19+
xycoords=xycoords, arrowprops=arrowprops) # wspace
20+
overlay.annotate("", (0, 0.8), (0.9, 0.8),
21+
xycoords=xycoords, arrowprops=arrowprops) # right
1922
fig.text(0.05, 0.7, "left", ha="center")
20-
fig.text(0.5, 0.7, "wspace", ha="center")
21-
fig.text(0.95, 0.7, "right", ha="center")
23+
fig.text(0.5, 0.3, "wspace", ha="center")
24+
fig.text(0.05, 0.83, "right", ha="center")
2225

23-
arrow((0.25, 0), (0.25, 0.1)) # bottom
24-
arrow((0.25, 0.435), (0.25, 0.565)) # hspace
25-
arrow((0.25, 0.9), (0.25, 1)) # top
26-
fig.text(0.28, 0.05, "bottom", va="center")
26+
overlay.annotate("", (0.75, 0), (0.75, 0.1),
27+
xycoords=xycoords, arrowprops=arrowprops) # bottom
28+
overlay.annotate("", (0.25, 0.435), (0.25, 0.565),
29+
xycoords=xycoords, arrowprops=arrowprops) # hspace
30+
overlay.annotate("", (0.8, 0), (0.8, 0.9),
31+
xycoords=xycoords, arrowprops=arrowprops) # top
32+
fig.text(0.65, 0.05, "bottom", va="center")
2733
fig.text(0.28, 0.5, "hspace", va="center")
28-
fig.text(0.28, 0.95, "top", va="center")
34+
fig.text(0.82, 0.05, "top", va="center")

‎doc/_static/mpl.css

Copy file name to clipboardExpand all lines: doc/_static/mpl.css
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,15 @@ div.wide-table table th.stub {
208208
.section-toc.toctree-wrapper .toctree-l1>ul{
209209
padding-left: 0;
210210
}
211+
212+
.sidebar-cheatsheets {
213+
margin-bottom: 3em;
214+
}
215+
216+
.sidebar-cheatsheets > h3 {
217+
margin-top: 0;
218+
}
219+
220+
.sidebar-cheatsheets > img {
221+
width: 100%;
222+
}

‎doc/_static/switcher.json

Copy file name to clipboardExpand all lines: doc/_static/switcher.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"name": "3.10 (stable)",
4-
"version": "3.10.1",
4+
"version": "3.10.3",
55
"url": "https://matplotlib.org/stable/",
66
"preferred": true
77
},

‎doc/_templates/cheatsheet_sidebar.html

Copy file name to clipboardExpand all lines: doc/_templates/cheatsheet_sidebar.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
<div class="sidebar-cheatsheets">
3-
<h3>Matplotlib cheatsheets</h3>
3+
<h3>Cheatsheets</h3>
44
<a href="https://matplotlib.org/cheatsheets/">
55
<img src="_static/mpl_cheatsheet1.png"
66
alt="Matplotlib cheatsheets"
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``PdfFile.fontNames``, ``PdfFile.dviFontInfo``, ``PdfFile.type1Descriptors``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... are deprecated with no replacement.
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
``FT2Image``
2+
~~~~~~~~~~~~
3+
... is deprecated. Use 2D uint8 ndarrays instead. In particular:
4+
5+
- The ``FT2Image`` constructor took ``width, height`` as separate parameters
6+
but the ndarray constructor takes ``(height, width)`` as single tuple
7+
parameter.
8+
- `.FT2Font.draw_glyph_to_bitmap` now (also) takes 2D uint8 arrays as input.
9+
- ``FT2Image.draw_rect_filled`` should be replaced by directly setting pixel
10+
values to black.
11+
- The ``image`` attribute of the object returned by ``MathTextParser("agg").parse``
12+
is now a 2D uint8 array.
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
``matplotlib.cm.get_cmap``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Colormaps are now available through the `.ColormapRegistry` accessible via
5+
`matplotlib.colormaps` or `matplotlib.pyplot.colormaps`.
6+
7+
If you have the name of a colormap as a string, you can use a direct lookup,
8+
``matplotlib.colormaps[name]`` or ``matplotlib.pyplot.colormaps[name]`` . Alternatively, ``matplotlib.colormaps.get_cmap`` will
9+
maintain the existing behavior of additionally passing through `.Colormap` instances
10+
and converting ``None`` to the default colormap. `matplotlib.pyplot.get_cmap` will stay as a
11+
shortcut to ``matplotlib.colormaps.get_cmap``.
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
``GridHelperCurveLinear.get_tick_iterator``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
... is removed with no replacement.
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*nth_coord* parameter to axisartist helpers for fixed axis
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Helper APIs in `.axisartist` for generating a "fixed" axis on rectilinear axes
5+
(`.FixedAxisArtistHelperRectilinear`) no longer take a *nth_coord* parameter.
6+
That parameter is entirely inferred from the (required) *loc* parameter.
7+
8+
For curvilinear axes, the *nth_coord* parameter remains supported (it affects
9+
the *ticks*, not the axis position itself), but it is now keyword-only.
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
``backend_ps.get_bbox_header``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
... is removed, as it is considered an internal helper.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.