Skip to content

Commit e222429

Browse files
committed
Merge branch 'master' into plot_directive_preserve
2 parents 644ce0f + 4753f6c commit e222429

File tree

208 files changed

+3780
-3153
lines changed

Some content is hidden

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

208 files changed

+3780
-3153
lines changed

.travis.yml

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,43 @@ env:
4545
- secure: RgJI7BBL8aX5FTOQe7xiXqWHMxWokd6GNUWp1NUV2mRLXPb9dI0RXqZt3UJwKTAzf1z/OtlHDmEkBoTVK81E9iUxK5npwyyjhJ8yTJmwfQtQF2n51Q1Ww9p+XSLORrOzZc7kAo6Kw6FIXN1pfctgYq2bQkrwJPRx/oPR8f6hcbY=
4646
- secure: E7OCdqhZ+PlwJcn+Hd6ns9TDJgEUXiUNEI0wu7xjxB2vBRRIKtZMbuaZjd+iKDqCKuVOJKu0ClBUYxmgmpLicTwi34CfTUYt6D4uhrU+8hBBOn1iiK51cl/aBvlUUrqaRLVhukNEBGZcyqAjXSA/Qsnp2iELEmAfOUa92ZYo1sk=
4747
- secure: "dfjNqGKzQG5bu3FnDNwLG8H/C4QoieFo4PfFmZPdM2RY7WIzukwKFNT6kiDfOrpwt+2bR7FhzjOGlDECGtlGOtYPN8XuXGjhcP4a4IfakdbDfF+D3NPIpf5VlE6776k0VpvcZBTMYJKNFIMc7QPkOwjvNJ2aXyfe3hBuGlKJzQU="
48+
- CYCLER=cycler
49+
- DATEUTIL=python-dateutil
50+
- MOCK=
51+
- NOSE=
4852
- NUMPY=numpy
49-
- OPENBLAS_NUM_THREADS=1
5053
- PANDAS=
54+
- PYPARSING=pyparsing
55+
- PYTEST=pytest!=3.3.0
56+
- PYTEST_COV=pytest-cov
57+
- PYTEST_PEP8=
58+
- SPHINX=sphinx
59+
- OPENBLAS_NUM_THREADS=1
5160
- NPROC=2
52-
- INSTALL_PEP8=
5361
- RUN_PEP8=
54-
- NOSE=
5562
- PYTEST_ARGS="-rawR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n $NPROC"
5663
- PYTHON_ARGS=
5764
- DELETE_FONT_CACHE=
5865

5966
matrix:
6067
include:
6168
- python: 2.7
62-
env: MOCK=mock NUMPY=numpy==1.7.1 PANDAS=pandas NOSE=nose
69+
# pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124.
70+
env:
71+
- CYCLER=cycler==0.10
72+
- DATEUTIL=python-dateutil==2.1
73+
- MOCK=mock
74+
- NOSE=nose
75+
- NUMPY=numpy==1.7.1
76+
- PANDAS='pandas<0.21.0'
77+
- PYPARSING=pyparsing==2.0.1
78+
- PYTEST=pytest==3.1.0
79+
- PYTEST_COV=pytest-cov==2.3.1
80+
- SPHINX=sphinx==1.3
6381
- python: 3.4
6482
env: PYTHON_ARGS=-OO
6583
- python: 3.6
66-
env: DELETE_FONT_CACHE=1 INSTALL_PEP8=pytest-pep8 RUN_PEP8=--pep8 PANDAS=pandas
84+
env: DELETE_FONT_CACHE=1 PANDAS='pandas<0.21.0' PYTEST_PEP8=pytest-pep8 RUN_PEP8=--pep8
6785
- python: "nightly"
6886
env: PRE=--pre
6987
- os: osx
@@ -110,16 +128,21 @@ install:
110128
# Upgrade pip and setuptools and wheel to get as clean an install as possible
111129
pip install --upgrade pip setuptools wheel
112130
- |
113-
# Install dependencies from pypi
131+
# Install dependencies from PyPI
114132
pip install --upgrade $PRE \
133+
codecov \
134+
coverage \
135+
$CYCLER \
115136
$MOCK \
116137
$NOSE \
117138
$NUMPY \
118139
$PANDAS \
119140
codecov \
120141
coverage \
121142
pillow \
122-
sphinx
143+
$PYPARSING \
144+
$DATEUTIL \
145+
$SPHINX
123146
# GUI toolkits are pip-installable only for some versions of Python so
124147
# don't fail if we can't install them. Make it easier to check whether the
125148
# install was successful by trying to import the toolkit (sometimes, the
@@ -140,15 +163,14 @@ install:
140163
echo 'wxPython is available' ||
141164
echo 'wxPython is not available'
142165
143-
# pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124
144166
pip install $PRE \
145-
pytest!=3.3.0 \
146-
pytest-cov>=2.3.1 \
167+
$PYTEST \
168+
$PYTEST_COV \
147169
pytest-faulthandler \
170+
$PYTEST_PEP8 \
148171
pytest-rerunfailures \
149172
pytest-timeout \
150-
pytest-xdist \
151-
$INSTALL_PEP8
173+
pytest-xdist
152174
153175
# Use the special local version of freetype for testing
154176
cp ci/travis/setup.cfg .

INSTALL.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Matplotlib requires a large number of dependencies:
170170
* `Python <https://www.python.org/downloads/>`_ (>= 2.7 or >= 3.4)
171171
* `NumPy <http://www.numpy.org>`_ (>= |minimum_numpy_version|)
172172
* `setuptools <https://setuptools.readthedocs.io/en/latest/>`__
173-
* `dateutil <https://pypi.python.org/pypi/python-dateutil>`_ (>= 2.0)
173+
* `dateutil <https://pypi.python.org/pypi/python-dateutil>`_ (>= 2.1)
174174
* `pyparsing <https://pyparsing.wikispaces.com/>`__
175175
* `libpng <http://www.libpng.org>`__ (>= 1.2)
176176
* `pytz <http://pytz.sourceforge.net/>`__

ci/travis/test_script.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/bash
22

3-
set -ev
3+
set -ex
44

55
# This script is meant to be called by the "script" step defined in
66
# .travis.yml. See http://docs.travis-ci.com/ for more details.
@@ -16,8 +16,5 @@ if [[ $DELETE_FONT_CACHE == 1 ]]; then
1616
fi
1717

1818
echo The following args are passed to pytest $PYTEST_ARGS $RUN_PEP8
19-
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
20-
pytest $PYTEST_ARGS $RUN_PEP8
21-
else
22-
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS -m pytest $PYTEST_ARGS $RUN_PEP8
23-
fi
19+
20+
pytest $PYTEST_ARGS $RUN_PEP8

doc-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
sphinx>=1.3,!=1.5.0,!=1.6.4
1010
colorspacious
1111
ipython
12+
ipywidgets
1213
mock
1314
numpydoc>=0.4
1415
pillow

doc/_templates/donate_sidebar.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
<div>
3-
<div onclick="open_window('MjI1OA==')" class="donate_button">Support Matplotlib</div>
4-
<div onclick="open_window('MjM2OA==')" class="donate_button">Support NumFOCUS</div>
3+
<a href="https://www.flipcause.com/secure/cause_pdetails/MjI1OA==" target="_blank"> <div class="donate_button" >Support Matplotlib</div></a>
4+
<a href="https://www.flipcause.com/secure/cause_pdetails/MTY3NTU=" target="_blank"> <div class="donate_button" >Support NumFOCUS</div></a>
55
</div>

doc/_templates/layout.html

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -344,52 +344,6 @@ <h3>{{ _('Navigation') }}</h3>
344344

345345
</style>
346346

347-
<script>
348-
349-
function open_window(cause_id) {
350-
var protocol=String(document.location.protocol);
351-
var new_url;
352-
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
353-
new_url="https://www.flipcause.com/widget/"+cause_id
354-
window.open(new_url);
355-
}
356-
357-
else {
358-
document.getElementById("fc-fade").style.display = "block";
359-
document.getElementById("fc-fade").style.webkitAnimation = "backfadesin 1s";
360-
document.getElementById("fc-fade").style.animation = "backfadesin 1s";
361-
document.getElementById("fc-fade").style.mozAnimation = "backfadesin 1s";
362-
document.getElementById("fc-light").style.display = "block";
363-
document.getElementById("fc-light").style.webkitAnimation = "fadesin 1.5s";
364-
document.getElementById("fc-light").style.animation = "fadesin 1.5s";
365-
document.getElementById("fc-light").style.mozAnimation = "fadesin 1.5s";
366-
document.getElementById("fc-main").style.display = "block";
367-
document.getElementById("fc-main").style.webkitAnimation = "fadesin 1.5s";
368-
document.getElementById("fc-main").style.animation = "fadesin 1.5s";
369-
document.getElementById("fc-main").style.mozAnimation = "fadesin 1.5s";
370-
document.getElementById("fc-close").style.display = "block";
371-
document.getElementById("fc-close").style.webkitAnimation = "fadesin 1.5s";
372-
document.getElementById("fc-close").style.animation = "fadesin 1.5s";
373-
document.getElementById("fc-close").style.mozAnimation = "fadesin 1.5s";
374-
document.getElementById("fc-myFrame").style.display = "block";
375-
document.getElementById("fc-myFrame").style.webkitAnimation = "fadesin 1.5s";
376-
document.getElementById("fc-myFrame").style.animation = "fadesin 1.5s";
377-
document.getElementById("fc-myFrame").style.mozAnimation = "fadesin 1.5s";
378-
document.getElementById("fc-myFrame").src="https://www.flipcause.com/widget/"+cause_id;
379-
}
380-
}
381-
382-
383-
function close_window() {
384-
document.getElementById("fc-fade").style.display="none";
385-
document.getElementById("fc-light").style.display="none";
386-
document.getElementById("fc-main").style.display="none";
387-
document.getElementById("fc-close").style.display="none";
388-
document.getElementById("fc-myFrame").style.display="none";
389-
}
390-
391-
</script>
392-
393347
<div id="fc-fade" class="fc-black_overlay" onclick="close_window()"></div>
394348
<div id="fc-light" class="fc-white_content">
395349
<div id="fc-main" class="fc-main-box">

doc/api/animation_api.rst

Lines changed: 33 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
======================
2-
``animation`` module
3-
======================
1+
*********
2+
animation
3+
*********
44

55
.. automodule:: matplotlib.animation
66
:no-members:
@@ -11,7 +11,6 @@
1111
:local:
1212
:backlinks: entry
1313

14-
1514
Animation
1615
=========
1716

@@ -37,7 +36,6 @@ To save an animation to disk use `Animation.save` or `Animation.to_html5_video`
3736
See :ref:`ani_writer_classes` below for details about what movie formats are
3837
supported.
3938

40-
4139
``FuncAnimation``
4240
-----------------
4341

@@ -48,7 +46,6 @@ The inner workings of `FuncAnimation` is more-or-less::
4846
fig.canvas.draw_idle()
4947
fig.canvas.start_event_loop(interval)
5048

51-
5249
with details to handle 'blitting' (to dramatically improve the live
5350
performance), to be non-blocking, not repeatedly start/stop the GUI
5451
event loop, handle repeats, multiple animated axes, and easily save
@@ -122,71 +119,66 @@ artist at a global scope and let Python sort things out. For example ::
122119
init_func=init, blit=True)
123120
plt.show()
124121

125-
126122
The second method is to us `functools.partial` to 'bind' artists to
127123
function. A third method is to use closures to build up the required
128124
artists and functions. A fourth method is to create a class.
129125

130-
131-
132-
133126
Examples
134127
~~~~~~~~
135128

136129
.. toctree::
137130
:maxdepth: 1
138131

139132
../gallery/animation/animate_decay
140-
../gallery/animation/bayes_update_sgskip
141-
../gallery/animation/double_pendulum_animated_sgskip
142-
../gallery/animation/dynamic_image
133+
../gallery/animation/bayes_update
134+
../gallery/animation/double_pendulum_sgskip
143135
../gallery/animation/histogram
144136
../gallery/animation/rain
145-
../gallery/animation/random_data
146-
../gallery/animation/simple_3danim
137+
../gallery/animation/random_walk
147138
../gallery/animation/simple_anim
148-
../gallery/animation/strip_chart_demo
139+
../gallery/animation/strip_chart
149140
../gallery/animation/unchained
150141

151142
``ArtistAnimation``
152143
-------------------
153144

154-
155145
Examples
156146
~~~~~~~~
157147

158148
.. toctree::
159149
:maxdepth: 1
160150

161-
../gallery/animation/basic_example
162-
../gallery/animation/basic_example_writer_sgskip
163-
../gallery/animation/dynamic_image2
164-
165-
166-
151+
../gallery/animation/dynamic_image
167152

168153
Writer Classes
169154
==============
170155

156+
The provided writers fall into a few broad categories.
171157

172-
173-
The provided writers fall into two broad categories: pipe-based and
174-
file-based. The pipe-based writers stream the captured frames over a
175-
pipe to an external process. The pipe-based variants tend to be more
176-
performant, but may not work on all systems.
158+
The Pillow writer relies on the Pillow library to write the animation, keeping
159+
all data in memory.
177160

178161
.. autosummary::
179162
:toctree: _as_gen
180163
:nosignatures:
181164

165+
PillowWriter
166+
167+
The pipe-based writers stream the captured frames over a pipe to an external
168+
process. The pipe-based variants tend to be more performant, but may not work
169+
on all systems.
170+
171+
.. autosummary::
172+
:toctree: _as_gen
173+
:nosignatures:
182174

183175
FFMpegWriter
184176
ImageMagickFileWriter
185177
AVConvWriter
186178

187-
Alternatively the file-based writers save temporary files for each
188-
frame which are stitched into a single file at the end. Although
189-
slower, these writers can be easier to debug.
179+
The file-based writers save temporary files for each frame which are stitched
180+
into a single file at the end. Although slower, these writers can be easier to
181+
debug.
190182

191183
.. autosummary::
192184
:toctree: _as_gen
@@ -196,7 +188,6 @@ slower, these writers can be easier to debug.
196188
ImageMagickWriter
197189
AVConvFileWriter
198190

199-
200191
Fundamentally, a `MovieWriter` provides a way to grab sequential frames
201192
from the same underlying `~matplotlib.figure.Figure` object. The base
202193
class `MovieWriter` implements 3 methods and a context manager. The
@@ -215,45 +206,39 @@ file to disk. For example ::
215206
moviewriter.grab_frame()
216207
moviewriter.finish()
217208

218-
219-
If using the writer classes directly (not through `Animation.save`), it is strongly encouraged
220-
to use the `~MovieWriter.saving` context manager ::
209+
If using the writer classes directly (not through `Animation.save`), it is
210+
strongly encouraged to use the `~MovieWriter.saving` context manager ::
221211

222212
with moviewriter.saving(fig, 'myfile.mp4', dpi=100):
223213
for j in range(n):
224214
update_figure(n)
225215
moviewriter.grab_frame()
226216

227-
228217
to ensures that setup and cleanup are performed as necessary.
229218

219+
Examples
220+
--------
230221

231-
:ref:`sphx_glr_gallery_animation_moviewriter_sgskip.py`
222+
.. toctree::
223+
:maxdepth: 1
232224

225+
../gallery/animation/frame_grabbing_sgskip
233226

234227
.. _ani_writer_classes:
235228

236229
Helper Classes
237230
==============
238231

239-
240232
Animation Base Classes
241233
----------------------
242234

243-
244235
.. autosummary::
245236
:toctree: _as_gen
246237
:nosignatures:
247238

248239
Animation
249240
TimedAnimation
250241

251-
252-
Custom Animation classes
253-
------------------------
254-
255-
:ref:`sphx_glr_gallery_animation_subplots.py`
256-
257242
Writer Registry
258243
---------------
259244

@@ -280,7 +265,7 @@ To reduce code duplication base classes
280265
MovieWriter
281266
FileMovieWriter
282267

283-
and mixins are provided
268+
and mixins
284269

285270
.. autosummary::
286271
:toctree: _as_gen
@@ -290,9 +275,9 @@ and mixins are provided
290275
FFMpegBase
291276
ImageMagickBase
292277

293-
See the source code for how to easily implement new `MovieWriter`
294-
classes.
278+
are provided.
295279

280+
See the source code for how to easily implement new `MovieWriter` classes.
296281

297282
Inheritance Diagrams
298283
====================

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy