Skip to content

Commit 2b93161

Browse files
authored
Merge branch 'main' into get-tick-params
2 parents 5dc5243 + 3d6c3da commit 2b93161

File tree

172 files changed

+5917
-5972
lines changed

Some content is hidden

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

172 files changed

+5917
-5972
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ per-file-ignores =
6060
lib/matplotlib/pyplot.py: F401, F811
6161
lib/matplotlib/tests/test_mathtext.py: E501
6262
lib/matplotlib/transforms.py: E201, E202, E203
63-
lib/matplotlib/tri/triinterpolate.py: E201, E221
63+
lib/matplotlib/tri/_triinterpolate.py: E201, E221
6464
lib/mpl_toolkits/axes_grid1/axes_size.py: E272
6565
lib/mpl_toolkits/axisartist/__init__.py: F401
6666
lib/mpl_toolkits/axisartist/angle_helper.py: E221

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
- [ ] Is [Flake 8](https://flake8.pycqa.org/en/latest/) compliant (install `flake8-docstrings` and run `flake8 --docstring-convention=all`).
99

1010
**Documentation**
11-
- [ ] New features are documented, with examples if plot related.
12-
- [ ] New features have an entry in `doc/users/next_whats_new/` (follow instructions in README.rst there).
13-
- [ ] API changes documented in `doc/api/next_api_changes/` (follow instructions in README.rst there).
1411
- [ ] Documentation is sphinx and numpydoc compliant (the docs should [build](https://matplotlib.org/devel/documenting_mpl.html#building-the-docs) without error).
12+
- [ ] New plotting related features are documented with examples.
13+
14+
**Release Notes**
15+
- [ ] New features are marked with a `.. versionadded::` directive in the docstring and documented in `doc/users/next_whats_new/`
16+
- [ ] API changes are marked with a `.. versionchanged::` directive in the docstring and documented in `doc/api/next_api_changes/`
17+
- [ ] Release notes conform with instructions in `next_whats_new/README.rst` or `next_api_changes/README.rst`
1518

1619
<!--
1720
Thank you so much for your PR! To help us review your contribution, please
@@ -22,7 +25,7 @@ consider the following points:
2225
- Help with git and github is available at
2326
https://matplotlib.org/devel/gitwash/development_workflow.html.
2427
25-
- Do not create the PR out of main, but out of a separate branch.
28+
- Create a separate branch for your changes and open the PR from this branch. Please avoid working on `main`.
2629
2730
- The PR title should summarize the changes, for example "Raise ValueError on
2831
non-numeric input to set_xlim". Avoid non-descriptive titles such as

.github/workflows/cibuildwheel.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
fetch-depth: 0
5454

5555
- name: Build wheels for CPython 3.11
56-
uses: pypa/[email protected].1
56+
uses: pypa/[email protected].2
5757
env:
5858
CIBW_BUILD: "cp311-*"
5959
CIBW_SKIP: "*-musllinux*"
@@ -66,7 +66,7 @@ jobs:
6666
CIBW_ARCHS: ${{ matrix.cibw_archs }}
6767

6868
- name: Build wheels for CPython 3.10
69-
uses: pypa/[email protected].1
69+
uses: pypa/[email protected].2
7070
env:
7171
CIBW_BUILD: "cp310-*"
7272
CIBW_SKIP: "*-musllinux*"
@@ -79,7 +79,7 @@ jobs:
7979
CIBW_ARCHS: ${{ matrix.cibw_archs }}
8080

8181
- name: Build wheels for CPython 3.9
82-
uses: pypa/[email protected].1
82+
uses: pypa/[email protected].2
8383
env:
8484
CIBW_BUILD: "cp39-*"
8585
CIBW_SKIP: "*-musllinux*"
@@ -92,7 +92,7 @@ jobs:
9292
CIBW_ARCHS: ${{ matrix.cibw_archs }}
9393

9494
- name: Build wheels for CPython 3.8
95-
uses: pypa/[email protected].1
95+
uses: pypa/[email protected].2
9696
env:
9797
CIBW_BUILD: "cp38-*"
9898
CIBW_SKIP: "*-musllinux*"
@@ -105,7 +105,7 @@ jobs:
105105
CIBW_ARCHS: ${{ matrix.cibw_archs }}
106106

107107
- name: Build wheels for PyPy
108-
uses: pypa/[email protected].1
108+
uses: pypa/[email protected].2
109109
env:
110110
CIBW_BUILD: "pp38-* pp39-*"
111111
CIBW_SKIP: "*-musllinux*"

.github/workflows/nightlies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
5050
# N.B. anaconda-client is only maintained on the main channel
5151
- name: Install anaconda-client
52-
uses: mamba-org/provision-with-micromamba@v13
52+
uses: mamba-org/provision-with-micromamba@v14
5353
with:
5454
environment-file: false
5555
environment-name: nightlies

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ jobs:
162162
163163
# Install dependencies from PyPI.
164164
python -m pip install --upgrade $PRE \
165-
'contourpy>=1.0.1' cycler fonttools kiwisolver numpy packaging \
166-
pillow pyparsing python-dateutil setuptools-scm \
165+
'contourpy>=1.0.1' cycler fonttools kiwisolver importlib_resources \
166+
numpy packaging pillow pyparsing python-dateutil setuptools-scm \
167167
-r requirements/testing/all.txt \
168168
${{ matrix.extra-requirements }}
169169

SECURITY.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@ versions.
1717

1818
## Reporting a Vulnerability
1919

20-
If you have found a security vulnerability, in order to keep it confidential,
21-
please do not report an issue on GitHub.
2220

23-
Please email us details of the vulnerability at [email protected];
24-
include a description and proof-of-concept that is [short and
25-
self-contained](http://www.sscce.org/).
21+
To report a security vulnerability, please use the [Tidelift security
22+
contact](https://tidelift.com/security). Tidelift will coordinate the fix and
23+
disclosure.
2624

27-
You should expect a response within a week of your email. Depending on the
28-
severity of the issue, this may require some time to draft an immediate bugfix
29-
release. Less severe issues may be held until the next release.
25+
If you have found a security vulnerability, in order to keep it confidential,
26+
please do not report an issue on GitHub.
3027

3128
We do not award bounties for security vulnerabilities.

doc/api/animation_api.rst

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ this means that the callable objects you pass in must know what
108108
artists they should be working on. There are several approaches to
109109
handling this, of varying complexity and encapsulation. The simplest
110110
approach, which works quite well in the case of a script, is to define the
111-
artist at a global scope and let Python sort things out. For example ::
111+
artist at a global scope and let Python sort things out. For example::
112112

113113
import numpy as np
114114
import matplotlib.pyplot as plt
@@ -133,8 +133,36 @@ artist at a global scope and let Python sort things out. For example ::
133133
init_func=init, blit=True)
134134
plt.show()
135135

136-
The second method is to use `functools.partial` to 'bind' artists to
137-
function. A third method is to use closures to build up the required
136+
The second method is to use `functools.partial` to pass arguments to the
137+
function::
138+
139+
import numpy as np
140+
import matplotlib.pyplot as plt
141+
from matplotlib.animation import FuncAnimation
142+
from functools import partial
143+
144+
fig, ax = plt.subplots()
145+
line1, = ax.plot([], [], 'ro')
146+
147+
def init():
148+
ax.set_xlim(0, 2*np.pi)
149+
ax.set_ylim(-1, 1)
150+
return line1,
151+
152+
def update(frame, ln, x, y):
153+
x.append(frame)
154+
y.append(np.sin(frame))
155+
ln.set_data(x, y)
156+
return ln,
157+
158+
ani = FuncAnimation(
159+
fig, partial(update, ln=line1, x=[], y=[]),
160+
frames=np.linspace(0, 2*np.pi, 128),
161+
init_func=init, blit=True)
162+
163+
plt.show()
164+
165+
A third method is to use closures to build up the required
138166
artists and functions. A fourth method is to create a class.
139167

140168
Examples

doc/api/blocking_input_api.rst

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

doc/api/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ Alphabetical list of modules:
105105
backend_tools_api.rst
106106
index_backend_api.rst
107107
bezier_api.rst
108-
blocking_input_api.rst
109108
category_api.rst
110109
cbook_api.rst
111110
cm_api.rst
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
``TrapezoidMapTriFinder`` uses different random number generator
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
The random number generator used to determine the order of insertion of
5+
triangle edges in ``TrapezoidMapTriFinder`` has changed. This can result in a
6+
different triangle index being returned for a point that lies exactly on an
7+
edge between two triangles. This can also affect triangulation interpolation
8+
and refinement algorithms that use ``TrapezoidMapTriFinder``.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
``matplotlib.tri`` submodules are deprecated
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
The ``matplotlib.tri.*`` submodules are deprecated. All functionality is
5+
available in ``matplotlib.tri`` directly and should be imported from there.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
``parse_fontconfig_pattern`` will no longer ignore unknown constant names
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
Previously, in a fontconfig pattern like ``DejaVu Sans:foo``, the unknown
4+
``foo`` constant name would be silently ignored. This now raises a warning,
5+
and will become an error in the future.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
``SimpleEvent``
2+
~~~~~~~~~~~~~~~
3+
The ``SimpleEvent`` nested class (previously accessible via the public
4+
subclasses of ``ConnectionStyle._Base``, such as `.ConnectionStyle.Arc`, has
5+
been deprecated.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
importlib_resources>=2.3.0 is now required on Python<3.10
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
Miscellaneous removals
2+
~~~~~~~~~~~~~~~~~~~~~~
3+
4+
- ``is_url`` and ``URL_REGEX`` are removed. (They were previously defined in
5+
the toplevel :mod:`matplotlib` module.)
6+
- The ``ArrowStyle.beginarrow`` and ``ArrowStyle.endarrow`` attributes are
7+
removed; use the ``arrow`` attribute to define the desired heads and tails
8+
of the arrow.
9+
- ``backend_pgf.LatexManager.str_cache`` is removed.
10+
- ``backends.qt_compat.ETS`` and ``backends.qt_compat.QT_RC_MAJOR_VERSION`` are
11+
removed, with no replacement.
12+
- The ``blocking_input`` module is removed. Instead, use
13+
``canvas.start_event_loop()`` and ``canvas.stop_event_loop()`` while
14+
connecting event callbacks as needed.
15+
- ``cbook.report_memory`` is removed; use ``psutil.virtual_memory`` instead.
16+
- ``cm.LUTSIZE`` is removed. Use :rc:`image.lut` instead. This value only
17+
affects colormap quantization levels for default colormaps generated at
18+
module import time.
19+
- ``Colorbar.patch`` is removed; this attribute was not correctly updated
20+
anymore.
21+
- ``ContourLabeler.get_label_width`` is removed.
22+
- ``Dvi.baseline`` is removed (with no replacement).
23+
- The *format* parameter of ``dviread.find_tex_file`` is removed (with no
24+
replacement).
25+
- ``FancyArrowPatch.get_path_in_displaycoord`` and
26+
``ConnectionPath.get_path_in_displaycoord`` are removed. The path in
27+
display coordinates can still be obtained, as for other patches, using
28+
``patch.get_transform().transform_path(patch.get_path())``.
29+
- The ``font_manager.win32InstalledFonts`` and
30+
``font_manager.get_fontconfig_fonts`` helper functions are removed.
31+
- All parameters of ``imshow`` starting from *aspect* are keyword-only.
32+
- ``QuadMesh.convert_mesh_to_paths`` and ``QuadMesh.convert_mesh_to_triangles``
33+
are removed. ``QuadMesh.get_paths()`` can be used as an alternative for the
34+
former; there is no replacement for the latter.
35+
- ``ScalarMappable.callbacksSM`` is removed. Use
36+
``ScalarMappable.callbacks`` instead.
37+
- ``streamplot.get_integrator`` is removed.
38+
- ``style.core.STYLE_FILE_PATTERN``, ``style.core.load_base_library``, and
39+
``style.core.iter_user_libraries`` are removed.
40+
- ``SubplotParams.validate`` is removed. Use `.SubplotParams.update` to
41+
change `.SubplotParams` while always keeping it in a valid state.
42+
- The ``grey_arrayd``, ``font_family``, ``font_families``, and ``font_info``
43+
attributes of `.TexManager` are removed.
44+
- ``Text.get_prop_tup`` is removed with no replacements (because the `.Text`
45+
class cannot know whether a backend needs to update cache e.g. when the
46+
text's color changes).
47+
- ``Tick.apply_tickdir`` didn't actually update the tick markers on the
48+
existing Line2D objects used to draw the ticks and is removed; use
49+
`.Axis.set_tick_params` instead.
50+
- ``tight_layout.auto_adjust_subplotpars`` is removed.
51+
- The ``grid_info`` attribute of ``axisartist`` classes has been removed.
52+
- ``axes_grid1.axes_grid.CbarAxes`` and ``axisartist.axes_grid.CbarAxes`` are
53+
removed (they are now dynamically generated based on the owning axes
54+
class).
55+
- The ``axes_grid1.Divider.get_vsize_hsize`` and
56+
``axes_grid1.Grid.get_vsize_hsize`` methods are removed.
57+
- ``AxesDivider.append_axes(..., add_to_figure=False)`` is removed. Use
58+
``ax.remove()`` to remove the Axes from the figure if needed.
59+
- ``FixedAxisArtistHelper.change_tick_coord`` is removed with no
60+
replacement.
61+
- ``floating_axes.GridHelperCurveLinear.get_boundary`` is removed with no
62+
replacement.
63+
- ``ParasiteAxesBase.get_images_artists`` is removed.
64+
- The "units finalize" signal (previously emitted by Axis instances) is
65+
removed. Connect to "units" instead.
66+
- Passing formatting parameters positionally to ``stem()`` is no longer
67+
possible.
68+
- ``axisartist.clip_path`` is removed with no replacement.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
``auto_add_to_figure=True`` for ``Axes3D``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
... is no longer supported. Instead use ``fig.add_axes(ax)``.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
The first parameter of ``Axes.grid`` and ``Axis.grid`` has been renamed to *visible*
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
The parameter was previously named *b*. This name change only matters if that
5+
parameter was passed using a keyword argument, e.g. ``grid(b=False)``.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Unused positional parameters to ``print_<fmt>`` methods
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
None of the ``print_<fmt>`` methods implemented by canvas subclasses used
5+
positional arguments other that the first (the output filename or file-like),
6+
so these extra parameters are removed.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
``QuadMesh`` signature
2+
~~~~~~~~~~~~~~~~~~~~~~
3+
4+
The `.QuadMesh` signature ::
5+
6+
def __init__(meshWidth, meshHeight, coordinates,
7+
antialiased=True, shading='flat', **kwargs)
8+
9+
is removed and replaced by the new signature ::
10+
11+
def __init__(coordinates, *, antialiased=True, shading='flat', **kwargs)
12+
13+
In particular:
14+
15+
- The *coordinates* argument must now be a (M, N, 2) array-like. Previously,
16+
the grid shape was separately specified as (*meshHeight* + 1, *meshWidth* +
17+
1) and *coordinates* could be an array-like of any shape with M * N * 2
18+
elements.
19+
- All parameters except *coordinates* are keyword-only now.

doc/api/prev_api_changes/api_changes_0.98.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Changes for 0.98.0
1212
rather than custom callback handling. Any users of
1313
``matplotlib.cm.ScalarMappable.add_observer`` of the
1414
:class:`~matplotlib.cm.ScalarMappable` should use the
15-
:attr:`matplotlib.cm.ScalarMappable.callbacksSM`
15+
``matplotlib.cm.ScalarMappable.callbacksSM``
1616
:class:`~matplotlib.cbook.CallbackRegistry` instead.
1717

1818
* New axes function and Axes method provide control over the plot

doc/api/prev_api_changes/api_changes_1.3.x.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Code changes
192192
by ``self.vline`` for vertical cursors lines and ``self.hline`` is added
193193
for the horizontal cursors lines.
194194

195-
* On POSIX platforms, the :func:`~matplotlib.cbook.report_memory` function
195+
* On POSIX platforms, the ``matplotlib.cbook.report_memory`` function
196196
raises :class:`NotImplementedError` instead of :class:`OSError` if the
197197
:command:`ps` command cannot be run.
198198

doc/api/prev_api_changes/api_changes_3.1.0.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,9 @@ consistent with the behavior on Py2, where a buffer object was
389389
returned.
390390

391391

392-
`matplotlib.font_manager.win32InstalledFonts` return type
393-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
394-
`matplotlib.font_manager.win32InstalledFonts` returns an empty list instead
392+
``matplotlib.font_manager.win32InstalledFonts`` return type
393+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
394+
``matplotlib.font_manager.win32InstalledFonts`` returns an empty list instead
395395
of None if no fonts are found.
396396

397397
``Axes.fmt_xdata`` and ``Axes.fmt_ydata`` error handling

0 commit comments

Comments
 (0)