Skip to content

Commit b0e10dc

Browse files
committed
Merge branch 'main' into simple-dvifontinfo
2 parents d7499b9 + 0dcd06f commit b0e10dc

File tree

165 files changed

+2121
-868
lines changed

Some content is hidden

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

165 files changed

+2121
-868
lines changed

.github/workflows/cibuildwheel.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ permissions:
2424
jobs:
2525
build_sdist:
2626
if: >-
27-
github.event_name == 'push' ||
28-
github.event_name == 'pull_request' && (
29-
(
30-
github.event.action == 'labeled' &&
31-
github.event.label.name == 'CI: Run cibuildwheel'
32-
) ||
33-
contains(github.event.pull_request.labels.*.name,
34-
'CI: Run cibuildwheel')
27+
github.repository == 'matplotlib/matplotlib' && (
28+
github.event_name == 'push' ||
29+
github.event_name == 'pull_request' && (
30+
(
31+
github.event.action == 'labeled' &&
32+
github.event.label.name == 'CI: Run cibuildwheel'
33+
) ||
34+
contains(github.event.pull_request.labels.*.name,
35+
'CI: Run cibuildwheel')
36+
)
3537
)
3638
name: Build sdist
3739
runs-on: ubuntu-latest
@@ -78,14 +80,16 @@ jobs:
7880

7981
build_wheels:
8082
if: >-
81-
github.event_name == 'push' ||
82-
github.event_name == 'pull_request' && (
83-
(
84-
github.event.action == 'labeled' &&
85-
github.event.label.name == 'CI: Run cibuildwheel'
86-
) ||
87-
contains(github.event.pull_request.labels.*.name,
88-
'CI: Run cibuildwheel')
83+
github.repository == 'matplotlib/matplotlib' && (
84+
github.event_name == 'push' ||
85+
github.event_name == 'pull_request' && (
86+
(
87+
github.event.action == 'labeled' &&
88+
github.event.label.name == 'CI: Run cibuildwheel'
89+
) ||
90+
contains(github.event.pull_request.labels.*.name,
91+
'CI: Run cibuildwheel')
92+
)
8993
)
9094
needs: build_sdist
9195
name: Build wheels on ${{ matrix.os }} for ${{ matrix.cibw_archs }}
@@ -137,7 +141,7 @@ jobs:
137141
path: dist/
138142

139143
- name: Build wheels for CPython 3.13
140-
uses: pypa/cibuildwheel@faf86a6ed7efa889faf6996aa23820831055001a # v2.23.3
144+
uses: pypa/cibuildwheel@5f22145df44122af0f5a201f93cf0207171beca7 # v3.0.0
141145
with:
142146
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
143147
env:
@@ -148,15 +152,15 @@ jobs:
148152
CIBW_ARCHS: ${{ matrix.cibw_archs }}
149153

150154
- name: Build wheels for CPython 3.12
151-
uses: pypa/cibuildwheel@faf86a6ed7efa889faf6996aa23820831055001a # v2.23.3
155+
uses: pypa/cibuildwheel@5f22145df44122af0f5a201f93cf0207171beca7 # v3.0.0
152156
with:
153157
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
154158
env:
155159
CIBW_BUILD: "cp312-*"
156160
CIBW_ARCHS: ${{ matrix.cibw_archs }}
157161

158162
- name: Build wheels for CPython 3.11
159-
uses: pypa/cibuildwheel@faf86a6ed7efa889faf6996aa23820831055001a # v2.23.3
163+
uses: pypa/cibuildwheel@5f22145df44122af0f5a201f93cf0207171beca7 # v3.0.0
160164
with:
161165
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
162166
env:
@@ -165,7 +169,7 @@ jobs:
165169

166170

167171
- name: Build wheels for PyPy
168-
uses: pypa/cibuildwheel@faf86a6ed7efa889faf6996aa23820831055001a # v2.23.3
172+
uses: pypa/cibuildwheel@5f22145df44122af0f5a201f93cf0207171beca7 # v3.0.0
169173
with:
170174
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
171175
env:
@@ -183,7 +187,7 @@ jobs:
183187
if-no-files-found: error
184188

185189
publish:
186-
if: github.event_name == 'push' && github.ref_type == 'tag'
190+
if: github.repository == 'matplotlib/matplotlib' && github.event_name == 'push' && github.ref_type == 'tag'
187191
name: Upload release to PyPI
188192
needs: [build_sdist, build_wheels]
189193
runs-on: ubuntu-latest
@@ -204,7 +208,7 @@ jobs:
204208
run: ls dist
205209

206210
- name: Generate artifact attestation for sdist and wheel
207-
uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0
211+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
208212
with:
209213
subject-path: dist/matplotlib-*
210214

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212

1313
jobs:
1414
analyze:
15+
if: github.repository == 'matplotlib/matplotlib'
1516
name: Analyze
1617
runs-on: ubuntu-latest
1718
permissions:
@@ -31,7 +32,7 @@ jobs:
3132
persist-credentials: false
3233

3334
- name: Initialize CodeQL
34-
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
35+
uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
3536
with:
3637
languages: ${{ matrix.language }}
3738

@@ -42,4 +43,4 @@ jobs:
4243
pip install --user -v .
4344
4445
- name: Perform CodeQL Analysis
45-
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
46+
uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0

.github/workflows/conflictcheck.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111

1212
jobs:
1313
main:
14+
if: github.repository == 'matplotlib/matplotlib'
1415
runs-on: ubuntu-latest
1516
permissions:
1617
pull-requests: write

.github/workflows/tests.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ jobs:
6464
python-version: '3.12'
6565
# https://github.com/matplotlib/matplotlib/issues/29844
6666
pygobject-ver: '<3.52.0'
67-
- os: ubuntu-22.04
67+
- name-suffix: "(Extra TeX packages)"
68+
os: ubuntu-22.04
6869
python-version: '3.13'
70+
extra-packages: 'texlive-fonts-extra texlive-lang-cyrillic'
6971
# https://github.com/matplotlib/matplotlib/issues/29844
7072
pygobject-ver: '<3.52.0'
7173
- name-suffix: "Free-threaded"
@@ -142,7 +144,8 @@ jobs:
142144
texlive-latex-recommended \
143145
texlive-luatex \
144146
texlive-pictures \
145-
texlive-xetex
147+
texlive-xetex \
148+
${{ matrix.extra-packages }}
146149
if [[ "${{ matrix.name-suffix }}" != '(Minimum Versions)' ]]; then
147150
sudo apt-get install -yy --no-install-recommends ffmpeg poppler-utils
148151
fi
@@ -343,13 +346,15 @@ jobs:
343346
run: |
344347
function remove_files() {
345348
local extension=$1
346-
find ./result_images -type f -name "*-expected*.$extension" | while read file; do
349+
find ./result_images -name "*-expected*.$extension" | while read file; do
347350
if [[ $file == *"-expected_pdf"* ]]; then
348351
base=${file%-expected_pdf.$extension}_pdf
349352
elif [[ $file == *"-expected_eps"* ]]; then
350353
base=${file%-expected_eps.$extension}_eps
351354
elif [[ $file == *"-expected_svg"* ]]; then
352355
base=${file%-expected_svg.$extension}_svg
356+
elif [[ $file == *"-expected_gif"* ]]; then
357+
base=${file%-expected_gif.$extension}_gif
353358
else
354359
base=${file%-expected.$extension}
355360
fi
@@ -366,7 +371,7 @@ jobs:
366371
done
367372
}
368373
369-
remove_files "png"; remove_files "svg"; remove_files "pdf"; remove_files "eps";
374+
remove_files "png"; remove_files "svg"; remove_files "pdf"; remove_files "eps"; remove_files "gif";
370375
371376
if [ "$(find ./result_images -mindepth 1 -type d)" ]; then
372377
find ./result_images/* -type d -empty -delete

doc/_embedded_plots/grouped_bar.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import matplotlib.pyplot as plt
2+
3+
categories = ['A', 'B']
4+
data0 = [1.0, 3.0]
5+
data1 = [1.4, 3.4]
6+
data2 = [1.8, 3.8]
7+
8+
fig, ax = plt.subplots(figsize=(4, 2.2))
9+
ax.grouped_bar(
10+
[data0, data1, data2],
11+
tick_labels=categories,
12+
labels=['dataset 0', 'dataset 1', 'dataset 2'],
13+
colors=['#1f77b4', '#58a1cf', '#abd0e6'],
14+
)
15+
ax.legend()

doc/api/axes_api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Basic
6767
Axes.bar
6868
Axes.barh
6969
Axes.bar_label
70+
Axes.grouped_bar
7071

7172
Axes.stem
7273
Axes.eventplot

doc/api/bezier_api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
.. automodule:: matplotlib.bezier
66
:members:
77
:undoc-members:
8+
:special-members: __call__
89
:show-inheritance:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
``BezierSegment.point_at_t``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
... is deprecated. Instead, it is possible to call the BezierSegment with an argument.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
``apply_theta_transforms`` option in ``PolarTransform``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Applying theta transforms in `~matplotlib.projections.polar.PolarTransform` and
5+
`~matplotlib.projections.polar.InvertedPolarTransform` has been removed, and
6+
the ``apply_theta_transforms`` keyword argument removed from both classes.
7+
8+
If you need to retain the behaviour where theta values
9+
are transformed, chain the ``PolarTransform`` with a `~matplotlib.transforms.Affine2D`
10+
transform that performs the theta shift and/or sign shift.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
``TransformNode.is_bbox``
2+
^^^^^^^^^^^^^^^^^^^^^^^^^
3+
4+
... is removed. Instead check the object using ``isinstance(..., BboxBase)``.
5+
6+
``rcsetup.interactive_bk``, ``rcsetup.non_interactive_bk`` and ``rcsetup.all_backends``
7+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8+
9+
... are removed and replaced by ``matplotlib.backends.backend_registry.list_builtin``
10+
with the following arguments
11+
12+
- ``matplotlib.backends.BackendFilter.INTERACTIVE``
13+
- ``matplotlib.backends.BackendFilter.NON_INTERACTIVE``
14+
- ``None``
15+
16+
``BboxTransformToMaxOnly``
17+
^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
19+
... is removed. It can be replaced by ``BboxTransformTo(LockableBbox(bbox, x0=0, y0=0))``.
20+
21+
*interval* parameter of ``TimerBase.start``
22+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23+
The timer interval parameter can no longer be set while starting it. The interval can be specified instead in the timer constructor, or by setting the timer.interval attribute.

doc/api/next_api_changes/removals/xxxxxx-DS.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

doc/api/pyplot_summary.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Basic
6060
bar
6161
barh
6262
bar_label
63+
grouped_bar
6364
stem
6465
eventplot
6566
pie

doc/devel/document.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,10 @@ understandable by humans. If the possible types are too complex use a
537537
simplification for the type description and explain the type more
538538
precisely in the text.
539539

540+
We do not use formal type annotation syntax for type descriptions in
541+
docstrings; e.g. we use ``list of str`` rather than ``list[str]``; we
542+
use ``int or str`` rather than ``int | str`` or ``Union[int, str]``.
543+
540544
Generally, the `numpydoc docstring guide`_ conventions apply. The following
541545
rules expand on them where the numpydoc conventions are not specific.
542546

doc/project/history.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Matplotlib logo (2008 - 2015).
157157

158158

159159
def add_math_background():
160-
ax = fig.add_axes([0., 0., 1., 1.])
160+
ax = fig.add_axes((0., 0., 1., 1.))
161161

162162
text = []
163163
text.append(
@@ -187,7 +187,7 @@ Matplotlib logo (2008 - 2015).
187187

188188

189189
def add_polar_bar():
190-
ax = fig.add_axes([0.025, 0.075, 0.2, 0.85], projection='polar')
190+
ax = fig.add_axes((0.025, 0.075, 0.2, 0.85), projection='polar')
191191

192192
ax.patch.set_alpha(axalpha)
193193
ax.set_axisbelow(True)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Grouped bar charts
2+
------------------
3+
4+
The new method `~.Axes.grouped_bar()` simplifies the creation of grouped bar charts
5+
significantly. It supports different input data types (lists of datasets, dicts of
6+
datasets, data in 2D arrays, pandas DataFrames), and allows for easy customization
7+
of placement via controllable distances between bars and between bar groups.
8+
9+
Example:
10+
11+
.. plot::
12+
:include-source: true
13+
:alt: Diagram of a grouped bar chart of 3 datasets with 2 categories.
14+
15+
import matplotlib.pyplot as plt
16+
17+
categories = ['A', 'B']
18+
datasets = {
19+
'dataset 0': [1, 11],
20+
'dataset 1': [3, 13],
21+
'dataset 2': [5, 15],
22+
}
23+
24+
fig, ax = plt.subplots()
25+
ax.grouped_bar(datasets, tick_labels=categories)
26+
ax.legend()
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Separate styling options for major/minor grid line in rcParams
2+
--------------------------------------------------------------
3+
4+
Using :rc:`grid.major.*` or :rc:`grid.minor.*` will overwrite the value in
5+
:rc:`grid.*` for the major and minor gridlines, respectively.
6+
7+
.. plot::
8+
:include-source: true
9+
:alt: Modifying the gridlines using the new options `rcParams`
10+
11+
import matplotlib as mpl
12+
import matplotlib.pyplot as plt
13+
14+
15+
# Set visibility for major and minor gridlines
16+
mpl.rcParams["axes.grid"] = True
17+
mpl.rcParams["ytick.minor.visible"] = True
18+
mpl.rcParams["xtick.minor.visible"] = True
19+
mpl.rcParams["axes.grid.which"] = "both"
20+
21+
# Using old values to set both major and minor properties
22+
mpl.rcParams["grid.color"] = "red"
23+
mpl.rcParams["grid.linewidth"] = 1
24+
25+
# Overwrite some values for major and minor separately
26+
mpl.rcParams["grid.major.color"] = "black"
27+
mpl.rcParams["grid.major.linewidth"] = 2
28+
mpl.rcParams["grid.minor.linestyle"] = ":"
29+
mpl.rcParams["grid.minor.alpha"] = 0.6
30+
31+
plt.plot([0, 1], [0, 1])
32+
33+
plt.show()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
PDF files created with usetex now embed subsets of Type 1 fonts
2+
---------------------------------------------------------------
3+
4+
When using the PDF backend with the usetex feature,
5+
Matplotlib calls TeX to render the text and formulas in the figure.
6+
The fonts that get used are usually "Type 1" fonts.
7+
They used to be embedded in full
8+
but are now limited to the glyphs that are actually used in the figure.
9+
This reduces the size of the resulting PDF files.

doc/users/prev_whats_new/dflt_style_changes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ a cleaner separation between subplots.
10051005

10061006
ax = fig.add_subplot(2, 2, j)
10071007
ax.hist(np.random.beta(0.5, 0.5, 10000), 25, density=True)
1008-
ax.set_xlim([0, 1])
1008+
ax.set_xlim(0, 1)
10091009
ax.set_title(title)
10101010

10111011
ax = fig.add_subplot(2, 2, j + 2)

0 commit comments

Comments
 (0)