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 ee90452

Browse filesBrowse files
committed
* 'master' of https://github.com/matplotlib/matplotlib: (50 commits) Set up CI with Azure Pipelines (#12617) Added comment for test. Correctly remove nans when drawing paths with pycairo. Improve docs on Axes limits and direction Extend sphinx Makefile to cleanup completely Remove explicit figure number Update contributing.rst Update contributing.rst DOC: Add badge and link to making PR tutorial Added test cases for scatter plot: 1) empty data/color, 2) pandas.Series with non-0 starting index. TST: mark test_constrainedlayout.py::test_colorbar_location as flaky (#12683) Remove deprecation warnings in tests (#12686) Make ticks in demo_axes_rgb.py visible Change ipython block to code-block Improve linestyles example (#12586) document-textpath Fix index out of bound error for testing first element of iterable. TST: test that get_ticks works FIX: fix error in colorbar.get_ticks not having valid data Replaced warnings.warn with either logging.warnings or cbook._warn_external ...
2 parents 78bd37b + 531bd02 commit ee90452
Copy full SHA for ee90452

File tree

Expand file treeCollapse file tree

93 files changed

+1360
-891
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
Expand file treeCollapse file tree

93 files changed

+1360
-891
lines changed

‎.flake8

Copy file name to clipboardExpand all lines: .flake8
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ per-file-ignores =
4141
matplotlib/mathtext.py: E201, E202, E203, E211, E221, E222, E225, E251, E301, E402
4242
matplotlib/projections/geo.py: E203, E221, E502
4343
matplotlib/pylab.py: E501
44-
matplotlib/rcsetup.py: E203, E225, E501
44+
matplotlib/rcsetup.py: E501
4545
matplotlib/sphinxext/plot_directive.py: E402
4646
matplotlib/tests/test_mathtext.py: E501
4747
matplotlib/transforms.py: E201, E202, E203, E501

‎README.rst

Copy file name to clipboardExpand all lines: README.rst
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
|Travis|_ |AppVeyor|_ |Codecov|_ |LGTM|_ |PyPi|_ |Gitter|_ |NUMFocus|_
1+
|Travis|_ |AppVeyor|_ |Codecov|_ |LGTM|_ |PyPi|_ |Gitter|_ |NUMFocus|_ |GitTutorial|_
22

33

44
.. |Travis| image:: https://travis-ci.org/matplotlib/matplotlib.svg?branch=master
@@ -22,6 +22,8 @@
2222
.. |NUMFocus| image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A
2323
.. _NUMFocus: http://www.numfocus.org
2424

25+
.. |GitTutorial| image:: https://img.shields.io/badge/PR-Welcome-%23FF8300.svg?
26+
.. _GitTutorial: https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project
2527

2628
##########
2729
Matplotlib
@@ -86,4 +88,4 @@ You want to tell us about it – best of all!
8688

8789
Start at the `contributing guide <http://matplotlib.org/devdocs/devel/contributing.html>`_!
8890

89-
Developer notes are now at `Developer Discussions <https://github.com/orgs/matplotlib/teams/developers/discussions>`_
91+
Developer notes are now at `Developer Discussions <https://github.com/orgs/matplotlib/teams/developers/discussions>`_ (Note: For technical reasons, this is currently only accessible for matplotlib developers.)

‎azure-pipelines.yml

Copy file name to clipboard
+53Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Python package
2+
# Create and test a Python package on multiple Python versions.
3+
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
5+
6+
jobs:
7+
8+
- job: 'Test'
9+
pool:
10+
vmImage: 'Ubuntu 16.04'
11+
strategy:
12+
matrix:
13+
Python35:
14+
python.version: '3.5'
15+
Python36:
16+
python.version: '3.6'
17+
Python37:
18+
python.version: '3.7'
19+
maxParallel: 4
20+
21+
steps:
22+
- task: UsePythonVersion@0
23+
inputs:
24+
versionSpec: '$(python.version)'
25+
architecture: 'x64'
26+
27+
- script: |
28+
29+
python -m pip install --upgrade pip
30+
pip install -r requirements/testing/travis_all.txt -r requirements/testing/travis36.txt
31+
32+
displayName: 'Install dependencies'
33+
34+
- script: |
35+
36+
export MPLLOCALFREETYPE=1
37+
pip install -ve .
38+
39+
displayName: "Install self"
40+
41+
- script: env
42+
displayName: 'print env'
43+
44+
- script: |
45+
env
46+
pytest --junitxml=junit/test-results.xml -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n 2
47+
displayName: 'pytest'
48+
49+
- task: PublishTestResults@2
50+
inputs:
51+
testResultsFiles: '**/test-results.xml'
52+
testRunTitle: 'Python $(python.version)'
53+
condition: succeededOrFailed()

‎doc-requirements.txt

Copy file name to clipboardExpand all lines: doc-requirements.txt
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ sphinx>=1.3,!=1.5.0,!=1.6.4,!=1.7.3,!=1.8.0
1010
colorspacious
1111
ipython
1212
ipywidgets
13-
numpydoc>=0.4
14-
pillow
15-
sphinx-gallery>=0.1.13
13+
numpydoc>=0.8
14+
pillow>=3.4
15+
sphinx-gallery>=0.2

‎doc/Makefile

Copy file name to clipboardExpand all lines: doc/Makefile
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ help:
1414

1515
.PHONY: help Makefile
1616

17+
# workaround because sphinx does not completely clean up (#11139)
18+
clean:
19+
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20+
rm -rf "$(SOURCEDIR)/build"
21+
rm -rf "$(SOURCEDIR)/api/_as_gen"
22+
rm -rf "$(SOURCEDIR)/gallery"
23+
rm -rf "$(SOURCEDIR)/tutorials"
24+
rm -rf "$(SOURCEDIR)/savefig"
25+
rm -rf "$(SOURCEDIR)/sphinxext/__pycache__"
26+
1727
# Catch-all target: route all unknown targets to Sphinx using the new
1828
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1929
%: Makefile

‎doc/_static/mpl.css

Copy file name to clipboardExpand all lines: doc/_static/mpl.css
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ td.field-body table.property-table tr:last-of-type td {
731731

732732
/*** function and class description ***/
733733
/* top-level definitions */
734-
dl.class, dl.function, dl.data {
734+
dl.class, dl.function, dl.data, dl.exception {
735735
border-top: 1px solid #888;
736736
padding-top: 0px;
737737
margin-top: 20px;
@@ -744,7 +744,7 @@ dl.method, dl.classmethod, dl.staticmethod, dl.attribute {
744744

745745

746746
dl.class > dt, dl.classmethod > dt, dl.method > dt, dl.function > dt,
747-
dl.attribute > dt, dl.staticmethod > dt, dl.data > dt {
747+
dl.attribute > dt, dl.staticmethod > dt, dl.data > dt, dl.exception > dt {
748748
background-color: #eff3f4;
749749
padding-left: 6px;
750750
padding-right: 6px;

‎doc/api/api_changes.rst

Copy file name to clipboardExpand all lines: doc/api/api_changes.rst
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ This pages lists API changes for the most recent version of Matplotlib.
3636
next_api_changes/*
3737

3838

39+
API Changes for 3.0.1
40+
=====================
41+
42+
`.tight_layout.auto_adjust_subplotpars` can return ``None`` now if the new
43+
subplotparams will collapse axes to zero width or height. This prevents
44+
``tight_layout`` from being executed. Similarly
45+
`.tight_layout.get_tight_layout_figure` will return None.
46+
3947
API Changes for 3.0.0
4048
=====================
4149

+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Passing a Line2D's drawstyle together with the linestyle is deprecated
2+
``````````````````````````````````````````````````````````````````````
3+
4+
Instead of ``plt.plot(..., linestyle="steps--")``, use ``plt.plot(...,
5+
linestyle="--", drawstyle="steps")``. ``ds`` is now an alias for ``drawstyle``.

‎doc/api/api_overview.rst

Copy file name to clipboardExpand all lines: doc/api/api_overview.rst
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ Further reading:
3838
- `matplotlib.axes.Axes` and `matplotlib.figure.Figure` for an overview of
3939
plotting functions.
4040
- Most of the :ref:`examples <examples-index>` use the object-oriented approach
41-
(except for the pyplot section).
41+
(except for the pyplot section)
42+
- The list of :doc:`matplotlib modules </api/index>`.
4243

4344

4445
The pylab API (disapproved)

‎doc/api/index.rst

Copy file name to clipboardExpand all lines: doc/api/index.rst
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Modules
5555
style_api.rst
5656
table_api.rst
5757
text_api.rst
58+
textpath_api.rst
5859
ticker_api.rst
5960
tight_layout_api.rst
6061
transformations.rst
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
API removals
2+
````````````
3+
The following API elements have been removed:
4+
5+
- ``font_manager.USE_FONTCONFIG``, ``font_manager.cachedir``,
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Passing a single string as *labels* to `Sankey.add`
2+
```````````````````````````````````````````````````
3+
4+
Previously, `Sankey.add` would only accept a single string as the *labels*
5+
argument if its length is equal to the number of flows, in which case it would
6+
use one character of the string for each flow.
7+
8+
The behavior has been changed to match the documented one: when a single string
9+
is passed, it is used to label all the flows.
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Changes to the signatures of `cbook.deprecated` and `cbook.warn_deprecated`
2+
```````````````````````````````````````````````````````````````````````````
3+
4+
All arguments to the `cbook.deprecated` decorator and `cbook.warn_deprecated`
5+
function, except the first one (the version where the deprecation occurred),
6+
are now keyword-only. The goal is to avoid accidentally setting the "message"
7+
argument when the "name" (or "alternative") argument was intended, as this has
8+
repeatedly occurred in the past.
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Matplotlib.use now has an ImportError for interactive backend
2+
-------------------------------------------------------------
3+
4+
Switching backends via `matplotlib.use` is now allowed by default,
5+
regardless of whether `matplotlib.pyplot` has been imported. If the user
6+
tries to switch from an already-started interactive backend to a different
7+
interactive backend, an ImportError will be raised.
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Invalid inputs
2+
``````````````
3+
4+
Passing invalid locations to `legend` and `table` used to fallback on a default
5+
location. This behavior is deprecated and will throw an exception in a future
6+
version.
7+
8+
`offsetbox.AnchoredText` is unable to handle the ``horizontalalignment`` or
9+
``verticalalignment`` kwargs, and used to ignore them with a warning. This
10+
behavior is deprecated and will throw an exception in a future version.
11+
12+
Passing steps less than 1 or greater than 10 to `MaxNLocator` used to result in
13+
undefined behavior. It now throws a ValueError.
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
``Axes.fmt_xdata`` and ``Axes.fmt_ydata`` no longer ignore TypeErrors raised by a user-provided formatter
2+
`````````````````````````````````````````````````````````````````````````````````````````````````````````
3+
4+
Previously, if the user provided a ``fmt_xdata`` or ``fmt_ydata`` function that
5+
raised a TypeError (or set them to a non-callable), the exception would be
6+
silently ignored and the default formatter be used instead. This is no longer
7+
the case; the exception is now propagated out.

‎doc/api/textpath_api.rst

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
********
2+
textpath
3+
********
4+
5+
6+
:mod:`matplotlib.textpath`
7+
==========================
8+
9+
.. automodule:: matplotlib.textpath
10+
:members:
11+
:undoc-members:
12+
:show-inheritance:

‎doc/devel/contributing.rst

Copy file name to clipboardExpand all lines: doc/devel/contributing.rst
+62-18Lines changed: 62 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ want to consider sending an email to the mailing list for more visibility.
208208
.. seealso::
209209

210210
* `Git documentation <https://git-scm.com/documentation>`_
211+
* `Git-Contributing to a Project <https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project>`_
212+
* `Introduction to Github <https://lab.github.com/githubtraining/introduction-to-github>`_
211213
* :ref:`development-workflow`.
212214
* :ref:`using-git`
213215

@@ -449,29 +451,71 @@ Then they will receive messages like::
449451
Which logging level to use?
450452
~~~~~~~~~~~~~~~~~~~~~~~~~~~
451453

452-
There are five levels at which you can emit messages. `logging.critical` and
453-
`logging.error` are really only there for errors that will end the use of the
454-
library but not kill the interpreter. `logging.warning` overlaps with the
455-
`warnings` library. The `logging tutorial`_ suggests that the difference
456-
between `logging.warning` and `warnings.warn` is that `warnings.warn` should
457-
be used for things the user must change to stop the warning (typically in the
458-
source), whereas `logging.warning` can be more persistent. Moreover, note
459-
that `warnings.warn` will by default only emit a given warning *once*, whereas
460-
`logging.warning` will display the message every time it is called.
454+
There are five levels at which you can emit messages.
455+
456+
- `logging.critical` and `logging.error` are really only there for errors that
457+
will end the use of the library but not kill the interpreter.
458+
- `logging.warning` and `cbook._warn_external` are used to warn the user,
459+
see below.
460+
- `logging.info` is for information that the user may want to know if the
461+
program behaves oddly. They are not displayed by default. For instance, if
462+
an object isn't drawn because its position is ``NaN``, that can usually
463+
be ignored, but a mystified user could call
464+
``logging.basicConfig(level=logging.INFO)`` and get an error message that
465+
says why.
466+
- `logging.debug` is the least likely to be displayed, and hence can be the
467+
most verbose. "Expected" code paths (e.g., reporting normal intermediate
468+
steps of layouting or rendering) should only log at this level.
461469

462470
By default, `logging` displays all log messages at levels higher than
463471
`logging.WARNING` to `sys.stderr`.
464472

465-
Calls to `logging.info` are not displayed by default. They are for
466-
information that the user may want to know if the program behaves oddly.
467-
For instance, if an object isn't drawn because its position is ``NaN``,
468-
that can usually be ignored, but a mystified user could call
469-
``logging.basicConfig(level=logging.INFO)`` and get an error message that
470-
says why.
473+
The `logging tutorial`_ suggests that the difference
474+
between `logging.warning` and `cbook._warn_external` (which uses
475+
`warnings.warn`) is that `cbook._warn_external` should be used for things the
476+
user must change to stop the warning (typically in the source), whereas
477+
`logging.warning` can be more persistent. Moreover, note that
478+
`cbook._warn_external` will by default only emit a given warning *once* for
479+
each line of user code, whereas `logging.warning` will display the message
480+
every time it is called.
471481

472-
`logging.debug` is the least likely to be displayed, and hence can be the most
473-
verbose. "Expected" code paths (e.g., reporting normal intermediate steps of
474-
layouting or rendering) should only log at this level.
482+
By default, `warnings.warn` displays the line of code that has the `warn` call.
483+
This usually isn't more informative than the warning message itself. Therefore,
484+
Matplotlib uses `cbook._warn_external` which uses `warnings.warn`, but goes
485+
up the stack and displays the first line of code outside of Matplotlib.
486+
For example, for the module::
487+
488+
# in my_matplotlib_module.py
489+
import warnings
490+
491+
def set_range(bottom, top):
492+
if bottom == top:
493+
warnings.warn('Attempting to set identical bottom==top')
494+
495+
496+
running the script::
497+
498+
from matplotlib import my_matplotlib_module
499+
my_matplotlib_module.set_range(0, 0) #set range
500+
501+
502+
will display::
503+
504+
UserWarning: Attempting to set identical bottom==top
505+
warnings.warn('Attempting to set identical bottom==top')
506+
507+
Modifying the module to use `cbook._warn_external`::
508+
509+
from matplotlib import cbook
510+
511+
def set_range(bottom, top):
512+
if bottom == top:
513+
cbook._warn_external('Attempting to set identical bottom==top')
514+
515+
and running the same script will display::
516+
517+
UserWarning: Attempting to set identical bottom==top
518+
my_matplotlib_module.set_range(0, 0) #set range
475519

476520
.. _logging tutorial: https://docs.python.org/3/howto/logging.html#logging-basic-tutorial
477521

‎doc/devel/documenting_mpl.rst

Copy file name to clipboardExpand all lines: doc/devel/documenting_mpl.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ requirements that are needed to build the documentation. They are listed in
5252
* Sphinx>=1.3, !=1.5.0, !=1.6.4, !=1.7.3
5353
* colorspacious
5454
* IPython
55-
* numpydoc>=0.4
56-
* Pillow
57-
* sphinx-gallery>=0.1.13
55+
* numpydoc>=0.8
56+
* Pillow>=3.4
57+
* sphinx-gallery>=0.2
5858
* graphviz
5959

6060
.. note::

‎doc/users/prev_whats_new/whats_new_1.5.rst

Copy file name to clipboardExpand all lines: doc/users/prev_whats_new/whats_new_1.5.rst
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,12 @@ that the draw command is deferred and only called once.
3636
The upshot of this is that for interactive backends (including
3737
``%matplotlib notebook``) in interactive mode (with ``plt.ion()``)
3838

39-
.. ipython :: python
39+
.. code-block :: python
4040
4141
import matplotlib.pyplot as plt
42-
4342
fig, ax = plt.subplots()
44-
4543
ln, = ax.plot([0, 1, 4, 9, 16])
46-
4744
plt.show()
48-
4945
ln.set_color('g')
5046
5147

0 commit comments

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