8000 Merge branch 'matplotlib:main' into bug-fix-issue-20243 · matplotlib/matplotlib@c5bea2f · GitHub
[go: up one dir, main page]

Skip to content

Commit c5bea2f

Browse files
Merge branch 'matplotlib:main' into bug-fix-issue-20243
2 parents e8d95d9 + 200808c commit c5bea2f

File tree

26 files changed

+361
-169
lines changed

26 files changed

+361
-169
lines changed

.github/workflows/codeql-analysis.yml

Lines 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@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
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@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
45+
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18

.github/workflows/reviewdog.yml

Lines changed: 14 additions & 0 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

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ jobs:
396396
fi
397397
- name: Upload code coverage
398398
if: ${{ !cancelled() && github.event_name != 'schedule' }}
399-
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
399+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
400400
with:
401401
name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }}"< F438 /div>
402402
token: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
``PdfFile.fontNames``, ``PdfFile.dviFontNames``, ``PdfFile.type1Descriptors``
2-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1+
``PdfFile.fontNames``, ``PdfFile.dviFontInfo``, ``PdfFile.type1Descriptors``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
... are deprecated with no replacement.
Lines 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.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Six and eight color Petroff color cycles
2+
----------------------------------------
3+
4+
The six and eight color accessible Petroff color cycles are named 'petroff6' and
5+
'petroff8'.
6+
They compliment the existing 'petroff10' color cycle, added in `Matplotlib 3.10.0`_
7+
8+
For more details see
9+
`Petroff, M. A.: "Accessible Color Sequences for Data Visualization"
10+
<https://arxiv.org/abs/2107.02270>`_.
11+
To load the 'petroff6' color cycle in place of the default::
12+
13+
import matplotlib.pyplot as plt
14+
plt.style.use('petroff6')
15+
16+
or to load the 'petroff8' color cycle::
17+
18+
import matplotlib.pyplot as plt
19+
plt.style.use('petroff8')
20+
21+
.. _Matplotlib 3.10.0: https://matplotlib.org/stable/users/prev_whats_new/whats_new_3.10.0.html#new-more-accessible-color-cycle

doc/users/resources/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ Tutorials
8282
<https://github.com/stefmolin/python-data-viz-workshop>`_
8383
by Stefanie Molin
8484

85+
* `Matplotlib Journey: Interactive Online Course
86+
<https://www.matplotlib-journey.com/>`_
87+
by Yan Holtz and Joseph Barbier
88+
8589
=========
8690
Galleries
8791
=========

lib/matplotlib/_cm.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,6 +1365,29 @@ def _gist_yarg(x): return 1 - x
13651365
(0.8509803921568627, 0.8509803921568627, 0.8509803921568627 ), # d9d9d9
13661366
)
13671367

1368+
# Colorblind accessible palettes from
1369+
# Matthew A. Petroff, Accessible Color Sequences for Data Visualization
1370+
# https://arxiv.org/abs/2107.02270
1371+
1372+
_petroff6_data = (
1373+
(0.3411764705882353, 0.5647058823529412, 0.9882352941176471), # 5790fc
1374+
(0.9725490196078431, 0.611764705882353, 0.12549019607843137), # f89c20
1375+
(0.8941176470588236, 0.1450980392156863, 0.21176470588235294), # e42536
1376+
(0.5882352941176471, 0.2901960784313726, 0.5450980392156862), # 964a8b
1377+
(0.611764705882353, 0.611764705882353, 0.6313725490196078), # 9c9ca1
1378+
(0.47843137254901963, 0.12941176470588237, 0.8666666666666667), # 7a21dd
1379< EED3 /td>+
)
1380+
1381+
_petroff8_data = (
1382+
(0.09411764705882353, 0.27058823529411763, 0.984313725490196), # 1845fb
1383+
(1.0, 0.3686274509803922, 0.00784313725490196), # ff5e02
1384+
(0.788235294117647, 0.12156862745098039, 0.08627450980392157), # c91f16
1385+
(0.7843137254901961, 0.28627450980392155, 0.6627450980392157), # c849a9
1386+
(0.6784313725490196, 0.6784313725490196, 0.49019607843137253), # adad7d
1387+
(0.5254901960784314, 0.7843137254901961, 0.8666666666666667), # 86c8dd
1388+
(0.3411764705882353, 0.5529411764705883, 1.0), # 578dff
1389+
(0.396078431372549, 0.38823529411764707, 0.39215686274509803), # 656364
1390+
)
13681391

13691392
_petroff10_data = (
13701393
(0.24705882352941178, 0.5647058823529412, 0.8549019607843137), # 3f90da

lib/matplotlib/artist.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -323,19 +323,28 @@ def get_window_extent(self, renderer=None):
323323
"""
324324
Get the artist's bounding box in display space.
325325
326-
The bounding box' width and height are nonnegative.
326+
The bounding box's width and height are non-negative.
327327
328328
Subclasses should override for inclusion in the bounding box
329329
"tight" calculation. Default is to return an empty bounding
330330
box at 0, 0.
331331
332-
Be careful when using this function, the results will not update
333-
if the artist window extent of the artist changes. The extent
334-
can change due to any changes in the transform stack, such as
335-
changing the Axes limits, the figure size, or the canvas used
336-
(as is done when saving a figure). This can lead to unexpected
337-
behavior where interactive figures will look fine on the screen,
338-
but will save incorrectly.
332+
.. warning::
333+
334+
The extent can change due to any changes in the transform stack, such
335+
as changing the Axes limits, the figure size, the canvas used (as is
336+
done when saving a figure), or the DPI.
337+
338+
Relying on a once-retrieved window extent can lead to unexpected
339+
behavior in various cases such as interactive figures being resized or
340+
moved to a screen with different dpi, or figures that look fine on
341+
screen render incorrectly when saved to file.
342+
343+
To get accurate results you may need to manually call
344+
`matplotlib.figure.Figure.savefig` or
345+
`matplotlib.figure.Figure.draw_without_rendering` to have Matplotlib
346+
compute the rendered size.
347+
339348
"""
340349
return Bbox([[0, 0], [0, 0]])
341350

0 commit comments

Comments
 (0)
0