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

Skip to content

Commit 8c5a947

Browse files
committed
Attempt to fix rebase issue
1 parent fa54783 commit 8c5a947

File tree

164 files changed

+12436
-9454
lines changed

Some content is hidden

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

164 files changed

+12436
-9454
lines changed

.flake8

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,10 @@ per-file-ignores =
4949
tools/subset.py: E221, E251, E261, E302, E501
5050

5151
lib/matplotlib/__init__.py: F401
52-
lib/matplotlib/_api/__init__.py: F401
5352
lib/matplotlib/_cm.py: E202, E203, E302
5453
lib/matplotlib/_mathtext.py: E221, E251
5554
lib/matplotlib/_mathtext_data.py: E203, E261
5655
lib/matplotlib/animation.py: F401
57-
lib/matplotlib/_animation_data.py: E501
5856
lib/matplotlib/axes/__init__.py: F401, F403
5957
lib/matplotlib/axes/_axes.py: F401
6058
lib/matplotlib/backends/backend_*.py: F401

.github/workflows/cibuildwheel.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,6 @@ jobs:
3434
run: |
3535
cp setup.cfg.template setup.cfg
3636
37-
- name: Build wheels for CPython 3.9
38-
run: |
39-
python -m cibuildwheel --output-dir dist
40-
env:
41-
CIBW_BUILD: "cp39-*"
42-
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
43-
CIBW_MANYLINUX_I686_IMAGE: manylinux1
44-
CIBW_BEFORE_BUILD: pip install certifi numpy==1.19.3
45-
MPL_DISABLE_FH4: "yes"
46-
4737
- name: Build wheels for CPython
4838
run: |
4939
python -m cibuildwheel --output-dir dist

LICENSE/LICENSE_JSXTOOLS_RESIZE_OBSERVER

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

doc/api/axis_api.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ Axis Label
7777
Axis.set_label_coords
7878
Axis.set_label_position
7979
Axis.set_label_text
80-
Axis.get_label
8180
Axis.get_label_position
8281
Axis.get_label_text
8382

doc/api/next_api_changes/behavior/18532-AL.rst

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

doc/api/next_api_changes/deprecations/18817-BGB.rst

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

doc/conf.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
import shutil
1414
import subprocess
1515
import sys
16-
import warnings
1716

1817
import matplotlib
19-
from matplotlib._api import MatplotlibDeprecationWarning
2018
import sphinx
2119

2220
from datetime import datetime
@@ -30,11 +28,6 @@
3028
# General configuration
3129
# ---------------------
3230

33-
# Unless we catch the warning explicitly somewhere, a warning should cause the
34-
# docs build to fail. This is especially useful for getting rid of deprecated
35-
# usage in the gallery.
36-
warnings.filterwarnings('error', append=True)
37-
3831
# Strip backslahes in function's signature
3932
# To be removed when numpydoc > 0.9.x
4033
strip_signature_backslash = True
@@ -113,20 +106,9 @@ def _check_dependencies():
113106

114107
autosummary_generate = True
115108

116-
# we should ignore warnings coming from importing deprecated modules for
117-
# autodoc purposes, as this will disappear automatically when they are removed
118-
warnings.filterwarnings('ignore', category=MatplotlibDeprecationWarning,
119-
module='importlib', # used by sphinx.autodoc.importer
120-
message=r'(\n|.)*module was deprecated.*')
121-
122109
autodoc_docstring_signature = True
123110
autodoc_default_options = {'members': None, 'undoc-members': None}
124111

125-
# make sure to ignore warnings that stem from simply inspecting deprecated
126-
# class-level attributes
127-
warnings.filterwarnings('ignore', category=MatplotlibDeprecationWarning,
128-
module='sphinx.util.inspect')
129-
130112
# missing-references names matches sphinx>=3 behavior, so we can't be nitpicky
131113
# for older sphinxes.
132114
nitpicky = sphinx.version_info >= (3,)

doc/devel/documenting_mpl.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ Optional, but recommended:
9191
* `optipng <http://optipng.sourceforge.net>`_
9292
* the font "Humor Sans" (aka the "XKCD" font), or the free alternative
9393
`Comic Neue <http://comicneue.com/>`_.
94-
* the font "Times New Roman"
9594

9695
.. note::
9796

doc/users/event_handling.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Event handling and picking
55
**************************
66

77
Matplotlib works with a number of user interface toolkits (wxpython,
8-
tkinter, qt, gtk, and macosx) and in order to support features like
8+
tkinter, qt4, gtk, and macosx) and in order to support features like
99
interactive panning and zooming of figures, it is helpful to the
1010
developers to have an API for interacting with the figure via key
1111
presses and mouse movements that is "GUI neutral" so we don't have to

doc/users/next_whats_new/2020-01-09-AL.rst

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

examples/animation/animated_histogram.py

Lines changed: 64 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,89 @@
33
Animated histogram
44
==================
55
6-
Use histogram's `.BarContainer` to draw a bunch of rectangles for an animated
7-
histogram.
6+
Use a path patch to draw a bunch of rectangles for an animated histogram.
87
"""
98

109
import numpy as np
1110

1211
import matplotlib.pyplot as plt
12+
import matplotlib.patches as patches
13+
import matplotlib.path as path
1314
import matplotlib.animation as animation
1415

1516
# Fixing random state for reproducibility
1617
np.random.seed(19680801)
17-
# Fixing bin edges
18-
HIST_BINS = np.linspace(-4, 4, 100)
1918

2019
# histogram our data with numpy
2120
data = np.random.randn(1000)
22-
n, _ = np.histogram(data, HIST_BINS)
21+
n, bins = np.histogram(data, 100)
22+
23+
# get the corners of the rectangles for the histogram
24+
left = bins[:-1]
25+
right = bins[1:]
26+
bottom = np.zeros(len(left))
27+
top = bottom + n
28+
nrects = len(left)
2329

2430
###############################################################################
25-
# To animate the histogram, we need an ``animate`` function, which generates
26-
# a random set of numbers and updates the heights of rectanges. We utilize a
27-
# python closure to track an instance of `.BarContainer` whose `.Rectangle`
28-
# patches we shall update.
31+
# Here comes the tricky part -- we have to set up the vertex and path codes
32+
# arrays using `.Path.MOVETO`, `.Path.LINETO` and `.Path.CLOSEPOLY` for each
33+
# rect.
34+
#
35+
# * We need 1 ``MOVETO`` per rectangle, which sets the initial point.
36+
# * We need 3 ``LINETO``'s, which tell Matplotlib to draw lines from
37+
# vertex 1 to vertex 2, v2 to v3, and v3 to v4.
38+
# * We then need one ``CLOSEPOLY`` which tells Matplotlib to draw a line from
39+
# the v4 to our initial vertex (the ``MOVETO`` vertex), in order to close the
40+
# polygon.
41+
#
42+
# .. note::
43+
#
44+
# The vertex for ``CLOSEPOLY`` is ignored, but we still need a placeholder
45+
# in the ``verts`` array to keep the codes aligned with the vertices.
46+
nverts = nrects * (1 + 3 + 1)
47+
verts = np.zeros((nverts, 2))
48+
codes = np.full(nverts, path.Path.LINETO)
49+
codes[0::5] = path.Path.MOVETO
50+
codes[4::5] = path.Path.CLOSEPOLY
51+
verts[0::5, 0] = left
52+
verts[0::5, 1] = bottom
53+
verts[1::5, 0] = left
54+
verts[1::5, 1] = top
55+
verts[2::5, 0] = right
56+
verts[2::5, 1] = top
57+
verts[3::5, 0] = right
58+
verts[3::5, 1] = bottom
2959

60+
###############################################################################
61+
# To animate the histogram, we need an ``animate`` function, which generates
62+
# a random set of numbers and updates the locations of the vertices for the
63+
# histogram (in this case, only the heights of each rectangle). ``patch`` will
64+
# eventually be a `.Patch` object.
65+
patch = None
3066

31-
def prepare_animation(bar_container):
3267

33-
def animate(frame_number):
34-
# simulate new data coming in
35-
data = np.random.randn(1000)
36-
n, _ = np.histogram(data, HIST_BINS)
37-
for count, rect in zip(n, bar_container.patches):
38-
rect.set_height(count)
39-
return bar_container.patches
40-
return animate
68+
def animate(i):
69+
# simulate new data coming in
70+
data = np.random.randn(1000)
71+
n, bins = np.histogram(data, 100)
72+
top = bottom + n
73+
verts[1::5, 1] = top
74+
verts[2::5, 1] = top
75+
return [patch, ]
4176

4277
###############################################################################
43-
# Using :func:`~matplotlib.pyplot.hist` allows us to get an instance of
44-
# `.BarContainer`, which is a collection of `.Rectangle` instances. Calling
45-
# ``prepare_animation`` will define ``animate`` function working with supplied
46-
# `.BarContainer`, all this is used to setup `.FuncAnimation`.
47-
78+
# And now we build the `.Path` and `.Patch` instances for the histogram using
79+
# our vertices and codes. We add the patch to the `~.axes.Axes` instance, and
80+
# setup the `.FuncAnimation` with our ``animate`` function.
4881
fig, ax = plt.subplots()
49-
_, _, bar_container = ax.hist(data, HIST_BINS, lw=1,
50-
ec="yellow", fc="green", alpha=0.5)
51-
ax.set_ylim(top=55) # set safe limit to ensure that all data is visible.
82+
barpath = path.Path(verts, codes)
83+
patch = patches.PathPatch(
84+
barpath, facecolor='green', edgecolor='yellow', alpha=0.5)
85+
ax.add_patch(patch)
86+
87+
ax.set_xlim(left[0], right[-1])
88+
ax.set_ylim(bottom.min(), top.max())
5289

53-
ani = animation.FuncAnimation(fig, prepare_animation(bar_container), 50,
54-
repeat=False, blit=True)
90+
ani = animation.FuncAnimation(fig, animate, 50, repeat=False, blit=True)
5591
plt.show()

examples/animation/rain.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525

2626
# Create rain data
2727
n_drops = 50
28-
rain_drops = np.zeros(n_drops, dtype=[('position', float, (2,)),
29-
('size', float),
30-
('growth', float),
31-
('color', float, (4,))])
28+
rain_drops = np.zeros(n_drops, dtype=[('position', float, 2),
29+
('size', float, 1),
30+
('growth', float, 1),
31+
('color', float, 4)])
3232

3333
# Initialize the raindrops in random positions and with
3434
# random growth rates.

examples/axes_grid1/demo_anchored_direction_arrows.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
========================
3-
Anchored Direction Arrow
4-
========================
2+
=============================
3+
Demo Anchored Direction Arrow
4+
=============================
55
66
"""
77
import matplotlib.pyplot as plt

examples/axes_grid1/demo_axes_divider.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
============
3-
Axes Divider
4-
============
2+
=================
3+
Demo Axes Divider
4+
=================
55
66
Axes divider to calculate location of axes and
77
create a divider for them using existing axes instances.

examples/axes_grid1/demo_axes_grid2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
==========
3-
Axes Grid2
4-
==========
2+
===============
3+
Demo Axes Grid2
4+
===============
55
66
Grid of images with shared xaxis and yaxis.
77
"""

0 commit comments

Comments
 (0)