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

Skip to content

Commit 1856c9b

Browse files
committed
Merge branch 'master' into temp
* master: (51 commits) Disable sticky edge accumulation if no autoscaling. Avoid quadratic behavior when accumulating stickies. Rectified plot error (matplotlib#12501) endless looping GIFs with PillowWriter (matplotlib#11789) TST: add test for re-normalizing image FIX: colorbar re-check norm before draw for autolabels Fix search for sphinx >=1.8 (matplotlib#12216) Fix some flake8 issues Don't handle impossible values for `align` in hist() DOC: add section about test / doc dependencies DOC: clarify time windows for support TST: test colorbar tick labels correct FIX: make minor ticks formatted with science formatter as well DOC: clarify what 'minor version' means Adjust the widths of the messages during the build. Simplify radar_chart example. Fix duplicate condition in pathpatch3d example (matplotlib#12495) Fix typo in documentation FIX: make unused spines invisible Kill FontManager.update_fonts. ...
2 parents f1dde27 + a2d2b80 commit 1856c9b

File tree

80 files changed

+1133
-1326
lines changed

Some content is hidden

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

80 files changed

+1133
-1326
lines changed

.flake8

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ per-file-ignores =
3030

3131
matplotlib/_cm.py: E202, E203, E302
3232
matplotlib/_mathtext_data.py: E203, E261
33-
matplotlib/backend_bases.py: E225
34-
matplotlib/backends/_backend_tk.py: E203, E222, E225, E301, E401, E501
33+
matplotlib/backends/_backend_tk.py: E501
3534
matplotlib/backends/backend_agg.py: E302
3635
matplotlib/backends/backend_cairo.py: E203, E221, E402
3736
matplotlib/backends/backend_gtk3.py: E203, E221, E222, E225, E251, E501
3837
matplotlib/backends/backend_pgf.py: E731
39-
matplotlib/backends/qt_editor/formlayout.py: E301, E501
38+
matplotlib/backends/qt_editor/formlayout.py: E501
4039
matplotlib/font_manager.py: E203, E221, E251, E501
4140
matplotlib/fontconfig_pattern.py: E201, E203, E221, E222, E225
4241
matplotlib/mathtext.py: E201, E202, E203, E211, E221, E222, E225, E251, E301, E402
@@ -82,7 +81,7 @@ per-file-ignores =
8281
tutorials/introductory/images.py: E402, E501
8382
tutorials/introductory/pyplot.py: E402, E501
8483
tutorials/introductory/sample_plots.py: E501
85-
tutorials/introductory/usage.py: E402, E501
84+
tutorials/introductory/usage.py: E501
8685
tutorials/text/annotations.py: E501
8786
tutorials/text/pgf.py: E501
8887
tutorials/text/text_intro.py: E402

doc/_templates/layout.html

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,27 @@ <h3>{{ _('Navigation') }}</h3>
7676
{%- endmacro %}
7777

7878
{%- macro script() %}
79-
<script type="text/javascript">
80-
var DOCUMENTATION_OPTIONS = {
81-
URL_ROOT: '{{ url_root }}',
82-
VERSION: '{{ release|e }}',
83-
COLLAPSE_INDEX: false,
84-
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
85-
HAS_SOURCE: {{ has_source|lower }},
86-
SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}'
87-
};
88-
</script>
89-
{%- for scriptfile in script_files %}
90-
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
91-
{%- endfor %}
79+
{% if sphinx_version >= "1.8.0" %}
80+
<script type="text/javascript" id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
81+
{%- for scriptfile in script_files %}
82+
{{ js_tag(scriptfile) }}
83+
{%- endfor %}
84+
{% else %}
85+
<script type="text/javascript">
86+
var DOCUMENTATION_OPTIONS = {
87+
URL_ROOT:'{{ url_root }}',
88+
VERSION:'{{ release|e }}',
89+
LANGUAGE:'{{ language }}',
90+
COLLAPSE_INDEX:false,
91+
FILE_SUFFIX:'{{ '' if no_search_suffix else file_suffix }}',
92+
HAS_SOURCE: {{ has_source|lower }},
93+
SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}'
94+
};
95+
</script>
96+
{%- for scriptfile in script_files %}
97+
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
98+
{%- endfor %}
99+
{% endif %}
92100
{%- endmacro %}
93101

94102
{%- macro css() %}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Deprecations
2+
````````````
3+
4+
The ``backend_bases.RendererBase.strip_math`` method is deprecated. Use
5+
`.cbook.strip_math` instead.

doc/api/api_changes/2018-10-10-AL.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
`Axes.streamplot` now raises ValueError when an irregular grid is passed in
2+
```````````````````````````````````````````````````````````````````````````
3+
4+
`Axes.streamplot` does not support irregularly gridded ``x`` and ``y`` values.
5+
So far, it used to silently plot an incorrect result. This has been changed to
6+
raise a ValueError instead.
7+
8+
The `.streamplot.Grid` class, which is internally used by streamplot code, also
9+
throws a ValueError when irregularly gridded values are passed in.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Exception on failing animations changed
2+
```````````````````````````````````````
3+
4+
Previously, subprocess failures in the animation framework would raise either
5+
in a `RuntimeError` or a `ValueError` depending on when the error occurred.
6+
They now raise a `subprocess.CalledProcessError` with attributes set as
7+
documented by the exception class.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Deprecations
2+
````````````
3+
4+
The following keyword arguments are deprecated:
5+
6+
- Passing ``shade=None`` to
7+
`~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_surface` is deprecated. This was
8+
an unintended implementation detail with the same semantics as
9+
``shade=False``. Please use the latter code instead.

doc/devel/min_dep_policy.rst

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,56 @@
44
Minimum Version of Dependencies Policy
55
======================================
66

7+
For the purpose of this document, 'minor version' is in the sense of
8+
SemVer (major, minor, patch) and includes both major and minor
9+
releases. For projects that use date-based versioning, every release
10+
is a 'minor version'.
11+
12+
713
Python and numpy
814
================
915

10-
- support minor versions of ``Python`` initially released in the previous
11-
3 years
12-
- support minor versions of ``numpy`` initially released in the
13-
previous 3 years or oldest that supports the minimum python version
14-
(which ever is higher)
16+
- support minor versions of ``Python`` initially released
17+
36 months prior to our planned release date.
18+
- support minor versions of ``numpy`` initially released in the 36
19+
months prior to our planned release date or oldest that supports the
20+
minimum python version (which ever is higher)
1521

1622
We will bump the minimum python and numpy versions as we can every
1723
minor and major release, but never on a patch release.
1824

1925
Python Dependencies
2026
===================
2127

22-
For python dependencies we should support at least
28+
For python dependencies we should support at least:
2329

2430
with compiled extensions
25-
minor versions released in the last 3 years
26-
or the oldest that support our minimum python + numpy
31+
minor versions initially released in the 36 months prior to our
32+
planned release date or the oldest that support our minimum python +
33+
numpy
2734

2835
without complied extensions
29-
minor versions released in the last 2 years or the oldest that
30-
supports our minimum python.
36+
minor versions initially released in the 24 months prior to our
37+
planed release date or the oldest that supports our minimum python.
3138

3239
We will only bump these dependencies as we need new features or the
3340
old versions no longer support our minimum numpy or python.
3441

42+
Test and Documentation Dependencies
43+
===================================
44+
45+
As these packages are only needed for testing or building the docs and
46+
not needed by end-users, we can be more aggressive about dropping
47+
support for old versions. However, we need to be careful to not
48+
over-run what down-stream packagers support (as most of the run the
49+
tests and build the documentation as part of the packaging process).
50+
51+
We will support at least minor versions of the development
52+
dependencies released in the 12 months prior to our planned release.
53+
54+
We will only bump these as needed or versions no longer support our
55+
minimum Python and numpy.
56+
3557

3658
System and C-dependencies
3759
=========================

doc/faq/howto_faq.rst

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,6 @@ that the bug reports will be a conversation. If you do not want to
578578
register with github, please email bug reports to the `mailing list
579579
580580

581-
582581
The easiest way to submit patches to Matplotlib is through pull
583582
requests on github. Please see the :ref:`developers-guide-index` for
584583
the details.
@@ -599,7 +598,7 @@ corners. This is where you come in.
599598
There is a good chance you know more about Matplotlib usage in some
600599
areas, the stuff you do every day, than many of the core developers
601600
who wrote most of the documentation. Just pulled your hair out
602-
compiling Matplotlib for windows? Write a FAQ or a section for the
601+
compiling Matplotlib for Windows? Write a FAQ or a section for the
603602
:ref:`installing-faq` page. Are you a digital signal processing wizard?
604603
Write a tutorial on the signal analysis plotting functions like
605604
:func:`~matplotlib.pyplot.xcorr`, :func:`~matplotlib.pyplot.psd` and
@@ -637,7 +636,7 @@ or look at the open issues on github.
637636
Matplotlib in a web application server
638637
======================================
639638

640-
Many users report initial problems trying to use maptlotlib in web
639+
Many users report initial problems trying to use Matplotlib in web
641640
application servers, because by default Matplotlib ships configured to
642641
work with a graphical user interface which may require an X11
643642
connection. Since many barebones application servers do not have X11
@@ -657,14 +656,14 @@ Agg is to call::
657656
matplotlib.use('Agg')
658657
import matplotlib.pyplot as plt
659658

660-
For more on configuring your backend, see
661-
:ref:`what-is-a-backend`.
659+
For more on configuring your backend, see :ref:`what-is-a-backend`.
662660

663661
Alternatively, you can avoid pylab/pyplot altogether, which will give
664662
you a little more control, by calling the API directly as shown in
665663
:doc:`/gallery/user_interfaces/canvasagg`.
666664

667-
You can either generate hardcopy on the filesystem by calling savefig::
665+
You can either generate hardcopy on the filesystem by calling
666+
`.Figure.savefig()`::
668667

669668
# do this before importing pylab or pyplot
670669
import matplotlib
@@ -692,21 +691,6 @@ Pillow for further processing::
692691
im = Image.open(imgdata)
693692

694693

695-
Matplotlib with apache
696-
----------------------
697-
698-
TODO; see :ref:`how-to-contribute-docs`.
699-
700-
Matplotlib with django
701-
----------------------
702-
703-
TODO; see :ref:`how-to-contribute-docs`.
704-
705-
Matplotlib with zope
706-
--------------------
707-
708-
TODO; see :ref:`how-to-contribute-docs`.
709-
710694
.. _howto-click-maps:
711695

712696
Clickable images for HTML
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Adjusted ``matplotlib.widgets.Slider`` to have vertical orientation
2+
-------------------------------------------------------------------
3+
4+
The :class:`matplotlib.widgets.Slider` widget now takes an optional argument
5+
``orientation`` which indicates the direction (``'horizontal'`` or
6+
``'vertical'``) that the slider should take.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:orphan:
2+
3+
Endless Looping GIFs with PillowWriter
4+
--------------------------------------
5+
6+
We acknowledge that most people want to watch a gif more than once. Saving an animation
7+
as a gif with PillowWriter now produces an endless looping gif.

examples/images_contours_and_fields/image_demo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
The most common way to plot images in Matplotlib is with
99
:meth:`~.axes.Axes.imshow`. The following examples demonstrate much of the
1010
functionality of imshow and the many images you can create.
11-
1211
"""
1312

1413
import numpy as np
@@ -54,7 +53,7 @@
5453

5554
with cbook.get_sample_data('ct.raw.gz', asfileobj=True) as datafile:
5655
s = datafile.read()
57-
A = np.fromstring(s, np.uint16).astype(float).reshape((w, h))
56+
A = np.frombuffer(s, np.uint16).astype(float).reshape((w, h))
5857
A /= A.max()
5958

6059
fig, ax = plt.subplots()

examples/misc/agg_buffer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
s, (width, height) = agg.print_to_buffer()
2222

2323
# Convert to a NumPy array.
24-
X = np.fromstring(s, np.uint8).reshape((height, width, 4))
24+
X = np.frombuffer(s, np.uint8).reshape((height, width, 4))
2525

2626
# Pass off to PIL.
2727
from PIL import Image

examples/mplot3d/pathpatch3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def text3d(ax, xyz, s, zdir="z", size=None, angle=0, usetex=False, **kwargs):
2929
x, y, z = xyz
3030
if zdir == "y":
3131
xy1, z1 = (x, z), y
32-
elif zdir == "y":
32+
elif zdir == "x":
3333
xy1, z1 = (y, z), x
3434
else:
3535
xy1, z1 = (x, y), z

examples/specialty_plots/leftventricle_bulleye.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def bullseye_plot(ax, data, segBold=None, cmap=None, norm=None):
2121
ax : axes
2222
data : list of int and float
2323
The intensity values for each of the 17 segments
24-
segBold: list of int, optional
24+
segBold : list of int, optional
2525
A list with the segments to highlight
2626
cmap : ColorMap or None, optional
2727
Optional argument to set the desired colormap

examples/specialty_plots/mri_demo.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,21 @@
33
MRI
44
===
55
6-
76
This example illustrates how to read an image (of an MRI) into a NumPy
87
array, and display it in greyscale using `imshow`.
9-
108
"""
119

1210
import matplotlib.pyplot as plt
1311
import matplotlib.cbook as cbook
14-
import matplotlib.cm as cm
1512
import numpy as np
1613

1714

18-
# Data are 256x256 16 bit integers
15+
# Data are 256x256 16 bit integers.
1916
with cbook.get_sample_data('s1045.ima.gz') as dfile:
20-
im = np.fromstring(dfile.read(), np.uint16).reshape((256, 256))
17+
im = np.frombuffer(dfile.read(), np.uint16).reshape((256, 256))
2118

2219
fig, ax = plt.subplots(num="MRI_demo")
23-
ax.imshow(im, cmap=cm.gray)
20+
ax.imshow(im, cmap="gray")
2421
ax.axis('off')
2522

2623
plt.show()

examples/specialty_plots/mri_with_eeg.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
histogram and some EEG traces.
88
"""
99

10-
1110
import numpy as np
1211
import matplotlib.pyplot as plt
1312
import matplotlib.cbook as cbook
@@ -20,7 +19,7 @@
2019

2120
# Load the MRI data (256x256 16 bit integers)
2221
with cbook.get_sample_data('s1045.ima.gz') as dfile:
23-
im = np.fromstring(dfile.read(), np.uint16).reshape((256, 256))
22+
im = np.frombuffer(dfile.read(), np.uint16).reshape((256, 256))
2423

2524
# Plot the MRI image
2625
ax0 = fig.add_subplot(2, 2, 1)

0 commit comments

Comments
 (0)