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

Skip to content

Commit 8013fe7

Browse files
committed
Merge branch 'master' of https://github.com/matplotlib/matplotlib into issue_10267
2 parents 3a7cebf + b2a9e10 commit 8013fe7

154 files changed

Lines changed: 5715 additions & 2566 deletions

File tree

Some content is hidden

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

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ install:
152152
python -c 'import pgi as gi; gi.require_version("Gtk", "3.0"); from pgi.repository import Gtk' &&
153153
echo 'pgi is available' ||
154154
echo 'pgi is not available'
155-
pip install pyqt5 &&
155+
pip install pyqt5==5.9 &&
156156
python -c 'import PyQt5.QtCore' &&
157157
echo 'PyQt5 is available' ||
158158
echo 'PyQt5 is not available'

doc/api/animation_api.rst

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,20 @@ Examples
153153
Writer Classes
154154
==============
155155

156-
The provided writers fall into two broad categories: pipe-based and
157-
file-based. The pipe-based writers stream the captured frames over a
158-
pipe to an external process. The pipe-based variants tend to be more
159-
performant, but may not work on all systems.
156+
The provided writers fall into a few broad categories.
157+
158+
The Pillow writer relies on the Pillow library to write the animation, keeping
159+
all data in memory.
160+
161+
.. autosummary::
162+
:toctree: _as_gen
163+
:nosignatures:
164+
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.
160170

161171
.. autosummary::
162172
:toctree: _as_gen
@@ -166,9 +176,9 @@ performant, but may not work on all systems.
166176
ImageMagickFileWriter
167177
AVConvWriter
168178

169-
Alternatively the file-based writers save temporary files for each
170-
frame which are stitched into a single file at the end. Although
171-
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.
172182

173183
.. autosummary::
174184
:toctree: _as_gen

doc/devel/documenting_mpl.rst

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ An example docstring looks like:
337337
338338
colors : array_like of colors, optional, default: 'k'
339339
340-
linestyles : ['solid' | 'dashed' | 'dashdot' | 'dotted'], optional
340+
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
341341
342342
label : string, optional, default: ''
343343
@@ -389,10 +389,9 @@ to keep in mind:
389389
Parameters
390390
----------
391391
projection :
392-
['aitoff' | 'hammer' | 'lambert' | 'mollweide' | \
393-
'polar' | 'rectilinear'], optional
392+
{'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', \
393+
'rectilinear'}, optional
394394
The projection type of the axes.
395-
"""
396395
397396
...
398397
"""
@@ -411,6 +410,14 @@ to keep in mind:
411410
-------
412411
lines : `~matplotlib.collections.LineCollection`
413412
413+
414+
Deprecated formatting conventions
415+
---------------------------------
416+
* Formerly, we have used square brackets for explicit parameter lists
417+
``['solid' | 'dashed' | 'dotted']``. With numpydoc we have switched to their
418+
standard using curly braces ``{'solid', 'dashed', 'dotted'}``.
419+
420+
414421
Linking to other code
415422
---------------------
416423
To link to other methods, classes, or modules in Matplotlib you can encase
@@ -478,6 +485,22 @@ acceptable values in the docs; it can also be displayed using, e.g.,
478485
``plt.setp(Line2D)`` (all properties) or ``plt.setp(Line2D, 'linestyle')``
479486
(just one property).
480487

488+
There are cases in which the ACCEPTS string is not useful in the
489+
generated Sphinx documentation, e.g. if the valid parameters are already
490+
defined in the numpydoc parameter list. You can hide the ACCEPTS string from
491+
Sphinx by making it a ReST comment (i.e. use ``.. ACCEPTS:``):
492+
493+
.. code-block:: python
494+
495+
def set_linestyle(self, linestyle):
496+
"""
497+
An ACCEPTS string invisible to Sphinx.
498+
499+
.. ACCEPTS: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' | ' ' | '' ]
500+
"""
501+
502+
503+
481504
Keyword arguments
482505
-----------------
483506

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Writing animations with Pillow
2+
------------------------------
3+
It is now possible to use Pillow as an animation writer. Supported output
4+
formats are currently gif (Pillow>=3.4) and webp (Pillow>=5.0). Use e.g. as ::
5+
6+
from __future__ import division
7+
8+
from matplotlib import pyplot as plt
9+
from matplotlib.animation import FuncAnimation, PillowWriter
10+
11+
fig, ax = plt.subplots()
12+
line, = plt.plot([0, 1])
13+
14+
def animate(i):
15+
line.set_ydata([0, i / 20])
16+
return [line]
17+
18+
anim = FuncAnimation(fig, animate, 20, blit=True)
19+
anim.save("movie.gif", writer=PillowWriter(fps=24))
20+
plt.show()
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Axes legends now included in tight_bbox
22
---------------------------------------
33

4-
Legends created via ``ax.legend()`` can sometimes overspill the limits of
4+
Legends created via ``ax.legend`` can sometimes overspill the limits of
55
the axis. Tools like ``fig.tight_layout()`` and
6-
``fig.savefig(bbox_inches='tight')`` would clip these legends. A change
6+
``fig.savefig(bbox_inches='tight')`` would clip these legends. A change
77
was made to include them in the ``tight`` calculations.

doc/users/next_whats_new/2017-10_capstyle.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
2-
Add ``capstyle`` and ``joinstyle`` attributes to `Collection`
3-
-------------------------------------------------------------
1+
``capstyle`` and ``joinstyle`` attributes added to `Collection`
2+
---------------------------------------------------------------
43

54
The `Collection` class now has customizable ``capstyle`` and ``joinstyle``
65
attributes. This allows the user for example to set the ``capstyle`` of
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
xlabels and ylabels can now be automatically aligned
2+
----------------------------------------------------
3+
4+
Subplot axes ``ylabels`` can be misaligned horizontally if the tick labels
5+
are very different widths. The same can happen to ``xlabels`` if the
6+
ticklabels are rotated on one subplot (for instance). The new methods
7+
on the `Figure` class: `Figure.align_xlabels` and `Figure.align_ylabels`
8+
will now align these labels horizontally or vertically. If the user only
9+
wants to align some axes, a list of axes can be passed. If no list is
10+
passed, the algorithm looks at all the labels on the figure.
11+
12+
Only labels that have the same subplot locations are aligned. i.e. the
13+
ylabels are aligned only if the subplots are in the same column of the
14+
subplot layout.
15+
16+
Alignemnt is persistent and automatic after these are called.
17+
18+
A convenience wrapper `Figure.align_labels` calls both functions at once.
19+
20+
.. plot::
21+
22+
import matplotlib.gridspec as gridspec
23+
24+
fig = plt.figure(figsize=(5, 3), tight_layout=True)
25+
gs = gridspec.GridSpec(2, 2)
26+
27+
ax = fig.add_subplot(gs[0,:])
28+
ax.plot(np.arange(0, 1e6, 1000))
29+
ax.set_ylabel('Test')
30+
for i in range(2):
31+
ax = fig.add_subplot(gs[1, i])
32+
ax.set_ylabel('Booooo')
33+
ax.set_xlabel('Hello')
34+
if i == 0:
35+
for tick in ax.get_xticklabels():
36+
tick.set_rotation(45)
37+
fig.align_labels()

doc/users/next_whats_new/2017_10_10_logging.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Logging for debug output
2-
------------------------
1+
Python logging library used for debug output
2+
--------------------------------------------
33

44
Matplotlib has in the past (sporadically) used an internal
55
verbose-output reporter. This version converts those calls to using the

doc/users/next_whats_new/2017_11_19_title_pad.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Add *pad* kwarg to ax.set_title
2-
-------------------------------
1+
*pad* kwarg added to ax.set_title
2+
---------------------------------
33

44
The method `axes.set_title` now has a *pad* kwarg, that specifies the
55
distance from the top of an axes to where the title is drawn. The units
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
Comparision of 2 colors in Matplotlib
22
-------------------------------------
33

4-
As the colors in Matplotlib can be specified with a wide variety of ways, this new version consists of a method `matplotlib.colors.same_color` which checks if two `~matplotlib.colors` are the same.
4+
As the colors in Matplotlib can be specified with a wide variety of ways, the
5+
`matplotlib.colors.same_color` method has been added which checks if
6+
two `~matplotlib.colors` are the same.

0 commit comments

Comments
 (0)