Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 21e1598

Browse files
Move widgets
1 parent da8789b commit 21e1598

File tree

170 files changed

+2518
-2510
lines changed

Some content is hidden

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

170 files changed

+2518
-2510
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ignore =
1313
N801, N802, N803, N806, N812,
1414
# pydocstyle
1515
D100, D101, D102, D103, D104, D105, D106, D107,
16-
D200, D202, D203, D204, D205, D207, D212, D213,
16+
D200, D202, D203, D204, D205, D207, D212,
1717
D301
1818
D400, D401, D402, D403, D413,
1919

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,5 @@ lib/z.lib
104104
#########################
105105

106106
jquery-ui-*/
107+
lib/matplotlib/backends/web_backend/node_modules/
108+
lib/matplotlib/backends/web_backend/package-lock.json

INSTALL.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ Dependencies
108108
Matplotlib requires the following dependencies:
109109

110110
* `Python <https://www.python.org/downloads/>`_ (>= 3.6)
111-
* `NumPy <http://www.numpy.org>`_ (>= 1.15)
111+
* `NumPy <https://numpy.org>`_ (>= 1.15)
112112
* `setuptools <https://setuptools.readthedocs.io/en/latest/>`_
113-
* `cycler <http://matplotlib.org/cycler/>`_ (>= 0.10.0)
113+
* `cycler <https://matplotlib.org/cycler/>`_ (>= 0.10.0)
114114
* `dateutil <https://pypi.org/project/python-dateutil>`_ (>= 2.1)
115115
* `kiwisolver <https://github.com/nucleic/kiwi>`_ (>= 1.0.0)
116116
* `Pillow <https://pillow.readthedocs.io/en/latest/>`_ (>= 6.2)

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
.. _Downloads: https://pepy.tech/project/matplotlib/month
3939

4040
.. |NUMFocus| image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A
41-
.. _NUMFocus: https://www.numfocus.org
41+
.. _NUMFocus: https://numfocus.org
4242

4343
.. image:: https://matplotlib.org/_static/logo2.svg
4444

azure-pipelines.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,7 @@ steps:
120120
testResultsFiles: '**/test-results.xml'
121121
testRunTitle: 'Python $(python.version)'
122122
condition: succeededOrFailed()
123+
124+
- publish: $(System.DefaultWorkingDirectory)/result_images
125+
artifact: $(Agent.JobName)-result_images
126+
condition: and(failed(), ne(variables['python.version'], 'Pre'))

doc/api/animation_api.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ at a time and ``finish()`` finalizes the movie and writes the output
212212
file to disk. For example ::
213213

214214
moviewriter = MovieWriter(...)
215-
moviewriter.setup(fig=fig, 'my_movie.ext', dpi=100)
215+
moviewriter.setup(fig, 'my_movie.ext', dpi=100)
216216
for j in range(n):
217-
update_figure(n)
217+
update_figure(j)
218218
moviewriter.grab_frame()
219219
moviewriter.finish()
220220

@@ -223,7 +223,7 @@ strongly encouraged to use the `~MovieWriter.saving` context manager ::
223223

224224
with moviewriter.saving(fig, 'myfile.mp4', dpi=100):
225225
for j in range(n):
226-
update_figure(n)
226+
update_figure(j)
227227
moviewriter.grab_frame()
228228

229229
to ensures that setup and cleanup are performed as necessary.

doc/api/api_changes.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ added to Matplotlib, see :ref:`whats-new`.
2121
.. note::
2222

2323
The list below is a table of contents of individual files from the
24-
'next_api_changes' folder.
24+
most recent :file:`api_changes_X.Y` folder.
2525

2626
When a release is made
2727

28-
- The files in 'next_api_changes/' should be moved to a new file in
29-
'prev_api_changes/'.
3028
- The include directive below should be changed to point to the new file
3129
created in the previous step.
3230

@@ -35,6 +33,6 @@ added to Matplotlib, see :ref:`whats-new`.
3533
:glob:
3634
:maxdepth: 1
3735

38-
next_api_changes/*
36+
api_changes_3.3/*
3937

4038
.. include:: prev_api_changes/api_changes_3.2.0.rst

doc/api/next_api_changes/README.rst renamed to doc/api/api_changes_3.3/README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Adding API change notes
44
=======================
55

6-
API change notes for future releases are collected in the directory
7-
:file:`next_api_changes`. They are divided into four categories:
6+
API change notes for future releases are collected in the most recent directory
7+
:file:`api_changes_X.Y`. They are divided into four categories:
88

99
- **Deprecations**: Announcements of future changes. Typically, these will
1010
raise a deprecation warning and users of this API should change their code
@@ -27,4 +27,3 @@ A typical entry could look like this::
2727
~~~~~~~~
2828
The unused `Locator.autoscale()` method is deprecated (pass the axis
2929
limits to `Locator.view_limits()` instead).
30-

doc/api/next_api_changes/behaviour.rst renamed to doc/api/api_changes_3.3/behaviour.rst

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ deprecation warning.
9898
`~.Axes.errorbar` now color cycles when only errorbar color is set
9999
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
100100

101-
Previously setting the *ecolor* would turn off automatic color cycling for the plot, leading to the
102-
the lines and markers defaulting to whatever the first color in the color cycle was in the case of
103-
multiple plot calls.
101+
Previously setting the *ecolor* would turn off automatic color cycling for the plot, leading to the
102+
the lines and markers defaulting to whatever the first color in the color cycle was in the case of
103+
multiple plot calls.
104104

105105
`.rcsetup.validate_color_for_prop_cycle` now always raises TypeError for bytes input
106106
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -155,3 +155,24 @@ support for it will be dropped in a future Matplotlib release.
155155
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156156
Previously, keyword arguments were silently ignored when no positional
157157
arguments were given.
158+
159+
`.Axis.get_minorticklabels` and `.Axis.get_majorticklabels` now returns plain list
160+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161+
Previously, `.Axis.get_minorticklabels` and `.Axis.get_majorticklabels` returns
162+
silent_list. Their return type is now changed to normal list.
163+
`.get_xminorticklabels`, `.get_yminorticklabels`, `.get_zminorticklabels`,
164+
`.Axis.get_ticklabels`, `.get_xmajorticklabels`, `.get_ymajorticklabels` and
165+
`.get_zmajorticklabels` methods will be affected by this change.
166+
167+
Default slider formatter
168+
~~~~~~~~~~~~~~~~~~~~~~~~
169+
The default method used to format `.Slider` values has been changed to use a
170+
`.ScalarFormatter` adapted the slider values limits. This should ensure that
171+
values are displayed with an appropriate number of significant digits even if
172+
they are much smaller or much bigger than 1. To restore the old behavior,
173+
explicitly pass a "%1.2f" as the *valfmt* parameter to `.Slider`.
174+
175+
``table.CustomCell`` is now an alias for `.table.Cell`
176+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177+
All the functionality of ``CustomCell`` has been moved to its base class
178+
`~.table.Cell`.

doc/api/next_api_changes/deprecations.rst renamed to doc/api/api_changes_3.3/deprecations.rst

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,12 @@ The ``Fil``, ``Fill``, ``Filll``, ``NegFil``, ``NegFill``, ``NegFilll``, and
366366
``SsGlue`` classes in the :mod:`matplotlib.mathtext` module are deprecated.
367367
As an alternative, directly construct glue instances with ``Glue("fil")``, etc.
368368

369-
NavigationToolbar2QT.parent
370-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
371-
This attribute is deprecated. In order to access the parent window, use
369+
NavigationToolbar2QT.parent and .basedir
370+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
371+
These attributes are deprecated. In order to access the parent window, use
372372
``toolbar.canvas.parent()``. Once the deprecation period is elapsed, it will
373-
also be accessible as ``toolbar.parent()``.
373+
also be accessible as ``toolbar.parent()``. The base directory to the icons
374+
is ``os.path.join(mpl.get_data_path(), "images")``.
374375

375376
Path helpers in :mod:`.bezier`
376377
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -422,3 +423,30 @@ Setting the *orientation* of an ``eventplot()`` or `.EventCollection` to "none"
422423
or None is deprecated; set it to "horizontal" instead. Moreover, the two
423424
orientations ("horizontal" and "vertical") will become case-sensitive in the
424425
future.
426+
427+
*minor* kwarg to `.Axis.get_ticklocs` will become keyword-only
428+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
429+
Passing this argument positionally is deprecated.
430+
431+
Case-insensitive properties
432+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
433+
Normalization of upper or mixed-case property names to lowercase in
434+
`.Artist.set` and `.Artist.update` is deprecated. In the future, property
435+
names will be passed as is, allowing one to pass names such as *patchA* or
436+
*UVC*.
437+
438+
``ContourSet.ax``, ``Quiver.ax``
439+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
440+
These attributes are deprecated in favor of ``ContourSet.axes`` and
441+
``Quiver.axes``, for consistency with other artists.
442+
443+
``Locator.refresh()`` and associated methods
444+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
445+
``Locator.refresh()`` is deprecated. This method was called at certain places
446+
to let locators update their internal state, typically based on the axis
447+
limits. Locators should now always consult the axis limits when called, if
448+
needed.
449+
450+
The associated helper methods ``NavigationToolbar2.draw()`` and
451+
``ToolViewsPositions.refresh_locators()`` are deprecated, and should be
452+
replaced by calls to ``draw_idle()`` on the corresponding canvas.

doc/api/axes_api.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ Adding Artists
447447
Axes.add_table
448448

449449

450-
Twinning
451-
========
450+
Twinning and sharing
451+
====================
452452

453453
.. autosummary::
454454
:toctree: _as_gen
@@ -458,6 +458,9 @@ Twinning
458458
Axes.twinx
459459
Axes.twiny
460460

461+
Axes.sharex
462+
Axes.sharey
463+
461464
Axes.get_shared_x_axes
462465
Axes.get_shared_y_axes
463466

doc/api/toolkits/mplot3d/faq.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
mplot3d FAQ
55
***********
66

7-
How is mplot3d different from MayaVi?
7+
How is mplot3d different from Mayavi?
88
=====================================
9-
`MayaVi2 <http://code.enthought.com/projects/mayavi/documentation.php>`_
9+
`Mayavi <https://docs.enthought.com/mayavi/mayavi/>`_
1010
is a very powerful and featureful 3D graphing library. For advanced
1111
3D scenes and excellent rendering capabilities, it is highly recommended to
12-
use MayaVi2.
12+
use Mayavi.
1313

1414
mplot3d was intended to allow users to create simple 3D graphs with the same
1515
"look-and-feel" as matplotlib's 2D plots. Furthermore, users can use the same
@@ -38,7 +38,7 @@ rendered properly in matplotlib's 2D rendering engine.
3838
This problem will likely not be solved until OpenGL support is added to all of
3939
the backends (patches are greatly welcomed). Until then, if you need complex
4040
3D scenes, we recommend using
41-
`MayaVi <http://code.enthought.com/projects/mayavi/documentation.php>`_.
41+
`MayaVi <https://docs.enthought.com/mayavi/mayavi/>`_.
4242

4343

4444
I don't like how the 3D plot is laid out, how do I change that?

doc/conf.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
# General configuration
2929
# ---------------------
3030

31+
# Strip backslahes in function's signature
32+
# To be removed when numpydoc > 0.9.x
33+
strip_signature_backslash = True
34+
3135
# Add any Sphinx extension module names here, as strings. They can be
3236
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
3337
extensions = [
@@ -102,7 +106,9 @@ def _check_dependencies():
102106
else:
103107
autodoc_default_options = {'members': None, 'undoc-members': None}
104108

105-
nitpicky = True
109+
# missing-references names matches sphinx>=3 behavior, so we can't be nitpicky
110+
# for older sphinxes.
111+
nitpicky = sphinx.version_info >= (3,)
106112
# change this to True to update the allowed failures
107113
missing_references_write_json = False
108114
missing_references_warn_unused_ignores = False
@@ -259,8 +265,10 @@ def _check_dependencies():
259265

260266
# Custom sidebar templates, maps page names to templates.
261267
html_sidebars = {
262-
'index': ['sidebar_announcement.html', 'sidebar_versions.html',
263-
'donate_sidebar.html'],
268+
'index': [
269+
# 'sidebar_announcement.html',
270+
'sidebar_versions.html',
271+
'donate_sidebar.html'],
264272
'**': ['localtoc.html', 'relations.html', 'pagesource.html']
265273
}
266274

doc/devel/MEP/MEP11.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Implementation
117117
For installing from source, and assuming the user has all of the
118118
C-level compilers and dependencies, this can be accomplished fairly
119119
easily using distribute_ and following the instructions `here
120-
<https://pypi.python.org/pypi/distribute>`_. The only anticipated
120+
<https://pypi.org/project/distribute>`_. The only anticipated
121121
change to the matplotlib library code will be to import pyparsing_
122122
from the top-level namespace rather than from within matplotlib. Note
123123
that distribute_ will also allow us to remove the direct dependency

doc/devel/MEP/MEP12.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ sections described above. "Clean-up" should involve:
105105

106106

107107
* PEP8_ clean-ups (running `flake8
108-
<https://pypi.python.org/pypi/flake8>`_, or a similar checker, is
108+
<https://pypi.org/project/flake8>`_, or a similar checker, is
109109
highly recommended)
110110
* Commented-out code should be removed.
111111
* Replace uses of `pylab` interface with `.pyplot` (+ `numpy`,
@@ -141,8 +141,8 @@ page instead of the gallery examples.
141141
references to that example. For example, the API documentation for
142142
:file:`axes.py` and :file:`pyplot.py` may use these examples to generate
143143
plots. Use your favorite search tool (e.g., grep, ack, `grin
144-
<https://pypi.python.org/pypi/grin>`_, `pss
145-
<https://pypi.python.org/pypi/pss>`_) to search the matplotlib
144+
<https://pypi.org/project/grin>`_, `pss
145+
<https://pypi.org/project/pss>`_) to search the matplotlib
146146
package. See `2dc9a46
147147
<https://github.com/tonysyu/matplotlib/commit/2dc9a4651e5e566afc0866c603aa8d06aaf32b71>`_
148148
and `aa6b410

doc/devel/coding_guide.rst

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
.. _pr-guidelines:
22

3+
.. raw:: html
4+
5+
<style>
6+
.checklist { list-style: none; padding: 0; margin: 0; }
7+
.checklist li { margin-left: 24px; padding-left: 23px; margin-right: 6px; }
8+
.checklist li:before { content: "\2610\2001"; margin-left: -24px; }
9+
.checklist li p {display: inline; }
10+
</style>
11+
312
***********************
413
Pull request guidelines
514
***********************
@@ -23,6 +32,8 @@ Summary for PR authors
2332

2433
When making a PR, pay attention to:
2534

35+
.. rst-class:: checklist
36+
2637
* :ref:`Target the master branch <pr-branch-selection>`.
2738
* Adhere to the :ref:`coding_guidelines`.
2839
* Update the :ref:`documentation <pr-documentation>` if necessary.
@@ -53,13 +64,17 @@ Summary for PR reviewers
5364

5465
Content topics:
5566

67+
.. rst-class:: checklist
68+
5669
* Is the feature / bugfix reasonable?
5770
* Does the PR conform with the :ref:`coding_guidelines`?
5871
* Is the :ref:`documentation <pr-documentation>` (docstrings, examples,
5972
what's new, API changes) updated?
6073

6174
Organizational topics:
6275

76+
.. rst-class:: checklist
77+
6378
* Make sure all :ref:`automated tests <pr-automated-tests>` pass.
6479
* The PR should :ref:`target the master branch <pr-branch-selection>`.
6580
* Tag with descriptive :ref:`labels <pr-labels>`.
@@ -95,7 +110,8 @@ Documentation
95110
:file:`doc/users/whats_new.rst`.
96111

97112
* If you change the API in a backward-incompatible way, please
98-
document it in the relevant file in :file:`doc/api/next_api_changes`.
113+
document it in the relevant file in most recent
114+
:file:`doc/api/api_changes_X.Y`.
99115

100116
.. _pr-labels:
101117

@@ -145,8 +161,8 @@ Merging
145161
the PR.
146162

147163
Ensure that all API changes are documented in the relevant file in
148-
:file:`doc/api/next_api_changes` and significant new features have and
149-
entry in :file:`doc/user/whats_new`.
164+
the most recent :file:`doc/api/api_changes_X.Y` and significant new features
165+
have an entry in :file:`doc/user/whats_new`.
150166

151167
- If a PR already has a positive review, a core developer (e.g. the first
152168
reviewer, but not necessarily) may champion that PR for merging. In order

doc/devel/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ Changes to the public API must follow a standard deprecation procedure to
318318
prevent unexpected breaking of code that uses Matplotlib.
319319

320320
- Deprecations must be announced via an entry in
321-
:file:`doc/api/next_api_changes`.
321+
the most recent :file:`doc/api/api_changes_X.Y`
322322
- Deprecations are targeted at the next point-release (i.e. 3.x.0).
323323
- The deprecated API should, to the maximum extent possible, remain fully
324324
functional during the deprecation period. In cases where this is not
@@ -327,7 +327,7 @@ prevent unexpected breaking of code that uses Matplotlib.
327327
- If possible, usage of an deprecated API should emit a
328328
`.MatplotlibDeprecationWarning`. There are a number of helper tools for this:
329329

330-
- Use `.cbook.warn_deprecated()` for general deprecation warnings.
330+
- Use ``cbook.warn_deprecated()`` for general deprecation warnings.
331331
- Use the decorator ``@cbook.deprecated`` to deprecate classes, functions,
332332
methods, or properties.
333333
- To warn on changes of the function signature, use the decorators

doc/devel/documenting_mpl.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,14 @@ Other packages can also be linked via
289289
`numpy.mean`
290290
291291
will return this link: `numpy.mean`. This works for Python, Numpy, Scipy,
292-
and Pandas (full list is in :file:`doc/conf.py`). Sometimes it is tricky
293-
to get external Sphinx linking to work; to
294-
check that a something exists to link to the following shell command outputs
295-
a list of all objects that can be referenced (in this case for Numpy)::
292+
and Pandas (full list is in :file:`doc/conf.py`). If external linking fails,
293+
you can check the full list of referenceable objects with the following
294+
commands::
296295

296+
python -m sphinx.ext.intersphinx 'https://docs.python.org/3/objects.inv'
297297
python -m sphinx.ext.intersphinx 'https://docs.scipy.org/doc/numpy/objects.inv'
298+
python -m sphinx.ext.intersphinx 'https://docs.scipy.org/doc/scipy/reference/objects.inv'
299+
python -m sphinx.ext.intersphinx 'https://pandas.pydata.org/pandas-docs/stable/objects.inv'
298300

299301
.. _rst-figures-and-includes:
300302

0 commit comments

Comments
 (0)