Skip to content

Commit 0df8646

Browse files
author
Michiel de Hoon
committed
Merge branch 'master' of git://github.com/matplotlib/matplotlib into fixForIssue4372
2 parents c44b4c2 + 7f9fb69 commit 0df8646

File tree

96 files changed

+7448
-6519
lines changed

Some content is hidden

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

96 files changed

+7448
-6519
lines changed

.travis.yml

+53-13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
sudo: false
2+
3+
addons:
4+
apt:
5+
packages:
6+
- inkscape
7+
- libav-tools
8+
- gdb
9+
- mencoder
10+
- dvipng
11+
- texlive-latex-base
12+
- texlive-latex-extra
13+
- texlive-fonts-recommended
14+
- texlive-latex-recommended
15+
- graphviz
16+
# - fonts-humor-sans
17+
# sources:
18+
# - debian-sid
19+
120
env:
221
global:
322
- ARTIFACTS_AWS_REGION=us-east-1
@@ -8,6 +27,7 @@ env:
827
- BUILD_DOCS=false
928
- TEST_ARGS=--no-pep8
1029
- NUMPY=numpy
30+
- NPROC=2
1131

1232
language: python
1333

@@ -22,26 +42,45 @@ matrix:
2242
env: TEST_ARGS=--pep8
2343
- python: 2.7
2444
env: BUILD_DOCS=true
45+
- python: "nightly"
46+
env: PRE=--pre
47+
allow_failures:
48+
- python : "nightly"
49+
50+
before_install:
51+
- source tools/travis_tools.sh
52+
# Install into our own pristine virtualenv
53+
- virtualenv --python=python venv
54+
- source venv/bin/activate
2555

2656
install:
27-
- pip install -q --use-mirrors nose python-dateutil $NUMPY pep8 pyparsing pillow sphinx!=1.3.0
28-
- sudo apt-get update && sudo apt-get -qq install inkscape libav-tools gdb mencoder
29-
# We use --no-install-recommends to avoid pulling in additional large latex docs that we don't need
57+
# Install only from travis wheelhouse
58+
- if [ -z "$PRE" ]; then
59+
wheelhouse_pip_install python-dateutil $NUMPY pyparsing pillow sphinx!=1.3.0;
60+
else
61+
pip install $PRE python-dateutil $NUMPY pyparsing pillow sphinx!=1.3.0;
62+
fi
63+
# Always install from pypi
64+
- pip install $PRE nose pep8
3065

3166
# We manually install humor sans using the package from Ubuntu 14.10. Unfortunatly humor sans is not
3267
# availible in the Ubuntu version used by Travis but we can manually install the deb from a later
3368
# version since is it basically just a .ttf file
69+
# The current Travis Ubuntu image is to old to search .local/share/fonts so we store fonts in .fonts
3470

3571
# We install ipython to use the console highlighting. From IPython 3 this depends on jsonschema and misture.
3672
# Neihter is installed as a dependency of IPython since they are not used by the IPython console.
3773
- |
3874
if [[ $BUILD_DOCS == true ]]; then
39-
sudo apt-get install -qq --no-install-recommends dvipng texlive-latex-base texlive-latex-extra texlive-fonts-recommended graphviz
40-
pip install numpydoc linkchecker ipython jsonschema mistune
75+
pip install $PRE numpydoc ipython jsonschema mistune
76+
pip install -q $PRE linkchecker
77+
wget https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O Felipa-Regular.ttf
4178
wget http://mirrors.kernel.org/ubuntu/pool/universe/f/fonts-humor-sans/fonts-humor-sans_1.0-1_all.deb
42-
sudo dpkg -i fonts-humor-sans_1.0-1_all.deb
43-
wget https://googlefontdirectory.googlecode.com/hg/ofl/felipa/Felipa-Regular.ttf
44-
sudo cp Felipa-Regular.ttf /usr/local/share/fonts/
79+
mkdir -p tmp
80+
mkdir -p ~/.fonts
81+
dpkg -x fonts-humor-sans_1.0-1_all.deb tmp
82+
cp tmp/usr/share/fonts/truetype/humor-sans/Humor-Sans.ttf ~/.fonts
83+
cp Felipa-Regular.ttf ~/.fonts
4584
fc-cache -f -v
4685
fi;
4786
- python setup.py install
@@ -50,17 +89,16 @@ script:
5089
# The number of processes is hardcoded, because using too many causes the
5190
# Travis VM to run out of memory (since so many copies of inkscape and
5291
# ghostscript are running at the same time).
53-
- echo Testing using 8 processes
92+
- echo Testing using $NPROC processes
5493
# Generate the font caches in a single process before starting the
5594
# multiple processes
56-
- gcc --version
5795
- python -c "from matplotlib import font_manager"
5896
- |
5997
if [[ $BUILD_DOCS == false ]]; then
6098
export MPL_REPO_DIR=$PWD # needed for pep8-conformance test of the examples
6199
mkdir ../tmp_test_dir
62100
cd ../tmp_test_dir
63-
gdb -return-child-result -batch -ex r -ex bt --args python ../matplotlib/tests.py -sv --processes=8 --process-timeout=300 $TEST_ARGS
101+
gdb -return-child-result -batch -ex r -ex bt --args python ../matplotlib/tests.py -s --processes=$NPROC --process-timeout=300 $TEST_ARGS
64102
else
65103
cd doc
66104
python make.py html --small --warningsaserrors
@@ -76,12 +114,14 @@ after_failure:
76114
cd $TRAVIS_BUILD_DIR/../tmp_test_dir
77115
tar cjf result_images.tar.bz2 result_images
78116
travis-artifacts upload --path result_images.tar.bz2
79-
echo "The result images will only be uploaded if they are on the matplotlib/matplotlib repo - this is for security reasons to prevent arbitrary PRs echoing security details." else echo https://s3.amazonaws.com/matplotlib-test-results/artifacts/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/result_images.tar.bz2
117+
echo https://s3.amazonaws.com/matplotlib-test-results/artifacts/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/result_images.tar.bz2
118+
else
119+
echo "The result images will only be uploaded if they are on the matplotlib/matplotlib repo - this is for security reasons to prevent arbitrary PRs echoing security details."
80120
fi
81121

82122
after_success:
83123
|
84-
if [[ $TRAVIS_PULL_REQUEST == false && $BUILD_DOCS == true && $TRAVIS_BRANCH == 'master' ]]; then
124+
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == 'matplotlib/matplotlib' && $BUILD_DOCS == true && $TRAVIS_BRANCH == 'master' ]]; then
85125
cd $TRAVIS_BUILD_DIR
86126
echo "Uploading documentation"
87127
openssl aes-256-cbc -K $encrypted_cc802e084cd0_key -iv $encrypted_cc802e084cd0_iv -in .travis/matplotlibDeployKey.enc -out .travis/matplotlibDeployKey -d
205 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Split `matplotlib.cbook.ls_mapper` in two
2+
`````````````````````````````````````````
3+
4+
The `matplotlib.cbook.ls_mapper` dictionary is split into two now to
5+
distinguish between qualified linestyle used by backends and
6+
unqualified ones. `ls_mapper` now maps from the short symbols
7+
(e.g. `"--"`) to qualified names (`"solid"`). The new ls_mapper_r is
8+
the reversed mapping.
9+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Removed `lod` from Artist
2+
`````````````````````````
3+
4+
Removed the method *set_lod* and all references to
5+
the attribute *_lod* as the are not used anywhere else in the
6+
code base. It appears to be a feature stub that was never built
7+
out.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Reordered `Axes.get_children`
2+
`````````````````````````````
3+
4+
The artist order returned by `Axes.get_children` did not
5+
match the one used by `Axes.draw`. They now use the same
6+
order, as `Axes.draw` now calls `Axes.get_children`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Disallow ``None`` as x or y value in ax.plot
2+
````````````````````````````````````````````
3+
4+
Do not allow ``None`` as a valid input for the ``x`` or ``y`` args in
5+
`ax.plot`. This may break some user code, but this was never officially
6+
supported (ex documented) and allowing ``None`` objects through can lead
7+
to confusing exceptions downstream.
8+
9+
To create an empty line use ::
10+
11+
ln1, = ax.plot([], [], ...)
12+
ln2, = ax.plot([], ...)
13+
14+
In either case to update the data in the `Line2D` object you must update
15+
both the ``x`` and ``y`` data.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Add salt to cilpPath id
2+
```````````````````````
3+
4+
Add salt to the hash used to determine the id of the ``clipPath``
5+
nodes. This is to avoid conflicts in two svg documents with the same
6+
clip path are included in the same document (see
7+
https://github.com/ipython/ipython/issues/8133 and
8+
https://github.com/matplotlib/matplotlib/issues/4349 ), however this
9+
means that the svg output is no longer deterministic if the same
10+
figure is saved twice. It is not expected that this will affect any
11+
users as the current ids are generated from an md5 hash of properties
12+
of the clip path and any user would have a very difficult time
13+
anticipating the value of the id.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Improved spacing in mathtext
2+
````````````````````````````
3+
4+
The extra space that appeared after subscripts and superscripts has
5+
been removed.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Changed snap threshold for circle markers to inf
2+
````````````````````````````````````````````````
3+
4+
When drawing circle markers above some marker size (previously 6.0)
5+
the path used to generate the marker was snapped to pixel centers. However,
6+
this ends up distorting the marker away from a circle. By setting the
7+
snap threshold to inf snapping is never done on circles.
8+
9+
This change broke several tests, but is an improvement.

doc/api/ticker_api.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ticker
44

55

66
:mod:`matplotlib.ticker`
7-
==========================
7+
========================
88

99
.. automodule:: matplotlib.ticker
1010
:members:

doc/devel/testing.rst

+11
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,17 @@ decorator:
173173
If some variation is expected in the image between runs, this
174174
value may be adjusted.
175175

176+
Freetype version
177+
----------------
178+
179+
Due to subtle differences in the font rendering under different
180+
version of freetype some care must be taken when generating the
181+
baseline images. Currently (early 2015), almost all of the images
182+
were generated using ``freetype 2.5.3-21`` on Fedora 21 and only the
183+
fonts that ship with ``matplotlib`` (regenerated in PR #4031 / commit
184+
005cfde02751d274f2ab8016eddd61c3b3828446) and travis is using
185+
``freetype 2.4.8`` on ubuntu.
186+
176187
Known failing tests
177188
-------------------
178189

doc/mpl_toolkits/index.rst

+11
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,14 @@ prettyplotlib
178178
`prettyplotlib <https://olgabot.github.io/prettyplotlib>`_ is an extension
179179
to matplotlib which changes many of the defaults to make plots some
180180
consider more attractive.
181+
182+
183+
iTerm2 terminal backend
184+
=======================
185+
(*Not distributed with matplotlib*)
186+
187+
`matplotlib_iterm2 <https://github.com/oselivanov/matplotlib_iterm2>`_ is an
188+
external matplotlib backend uses iTerm2 nightly build inline image display
189+
feature.
190+
191+
.. image:: /_static/matplotlib_iterm2_demo.png

doc/users/whats_new/cbook.rst

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
cbook.is_sequence_of_strings recognizes string objects
2+
``````````````````````````````````````````````````````
3+
4+
This is primarily how pandas stores a sequence of strings.
5+
6+
import pandas as pd
7+
import matplotlib.cbook as cbook
8+
9+
a = np.array(['a', 'b', 'c'])
10+
print(cbook.is_sequence_of_strings(a)) # True
11+
12+
a = np.array(['a', 'b', 'c'], dtype=object)
13+
print(cbook.is_sequence_of_strings(a)) # True
14+
15+
s = pd.Series(['a', 'b', 'c'])
16+
print(cbook.is_sequence_of_strings(s)) # True
17+
18+
Previously, the last two prints returned false.

doc/users/whats_new/linestyles.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Mostly unified linestyles for Lines, Patches and Collections
2+
````````````````````````````````````````````````````````````
3+
4+
The handling of linestyles for Lines, Patches and Collections has been
5+
unified. Now they all support defining linestyles with short symbols,
6+
like `"--"`, as well as with full names, like `"dashed"`. Also the
7+
definition using a dash pattern (`(0., [3., 3.])`) is supported for all
8+
methods using Lines, Patches or Collections.

doc/users/whats_new/rcparams.rst

+11-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,17 @@ but not yet implemented.
1212

1313
Added "figure.titlesize" and "figure.titleweight" keys to rcParams
1414
``````````````````````````````````````````````````````````````````
15-
Two new keys were added to rcParams to control the default font size and weight
16-
used by the figure title (as emitted by ``pyplot.suptitle()``).
15+
16+
Two new keys were added to rcParams to control the default font size
17+
and weight used by the figure title (as emitted by
18+
``pyplot.suptitle()``).
19+
20+
Added ``legend.facecolor`` and ``legend.edgecolor`` keys to rcParams
21+
```````````````````````````````````````````````````````````````````
22+
23+
The new keys control colors (background and edge) of legend patches.
24+
The value ``'inherit'`` for these rcParams falls uses the value of
25+
``axes.facecolor`` and ``axes.edgecolor``.
1726

1827

1928
``image.composite_image`` added to rcParams
@@ -28,4 +37,3 @@ Added "toolmanager" to "toolbar" possible values
2837
````````````````````````````````````````````````
2938

3039
The new value enables the use of ``ToolManager``
31-

doc/users/whats_new/updated_table.rst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Updated Table and to control edge visibility
2+
--------------------------------------------
3+
Added the ability to toggle the visibility of lines in Tables.
4+
Functionality added to the table() factory function under the keyword argument "edges".
5+
Values can be the strings "open", "closed", "horizontal", "vertical" or combinations of the letters "L", "R", "T", "B" which represent left, right, top, and bottom respectively.
6+
7+
Example:
8+
table(..., edges="open") # No line visible
9+
table(..., edges="closed") # All lines visible
10+
table(..., edges="horizontal") # Only top and bottom lines visible
11+
table(..., edges="LT") # Only left and top lines visible.

examples/animation/bayes_update.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ def __call__(self, i):
4040
self.line.set_data(self.x, y)
4141
return self.line,
4242

43-
fig = plt.figure()
44-
ax = fig.add_subplot(1, 1, 1)
43+
fig, ax = plt.subplots()
4544
ud = UpdateDist(ax, prob=0.7)
4645
anim = FuncAnimation(fig, ud, frames=np.arange(100), init_func=ud.init,
4746
interval=100, blit=True)

examples/images_contours_and_fields/pcolormesh_levels.py

+15-14
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
y, x = np.mgrid[slice(1, 5 + dy, dy),
1919
slice(1, 5 + dx, dx)]
2020

21-
z = np.sin(x) ** 10 + np.cos(10 + y * x) * np.cos(x)
21+
z = np.sin(x)**10 + np.cos(10 + y*x) * np.cos(x)
2222

2323
# x and y are bounds, so z should be the value *inside* those bounds.
2424
# Therefore, remove the last value from the z array.
@@ -31,22 +31,23 @@
3131
cmap = plt.get_cmap('PiYG')
3232
norm = BoundaryNorm(levels, ncolors=cmap.N, clip=True)
3333

34-
plt.subplot(2, 1, 1)
35-
im = plt.pcolormesh(x, y, z, cmap=cmap, norm=norm)
36-
plt.colorbar()
37-
# set the limits of the plot to the limits of the data
38-
plt.axis([x.min(), x.max(), y.min(), y.max()])
39-
plt.title('pcolormesh with levels')
34+
fig, (ax0, ax1) = plt.subplots(nrows=2)
35+
36+
im = ax0.pcolormesh(x, y, z, cmap=cmap, norm=norm)
37+
fig.colorbar(im, ax=ax0)
38+
ax0.set_title('pcolormesh with levels')
4039

4140

42-
plt.subplot(2, 1, 2)
4341
# contours are *point* based plots, so convert our bound into point
4442
# centers
45-
plt.contourf(x[:-1, :-1] + dx / 2.,
46-
y[:-1, :-1] + dy / 2., z, levels=levels,
47-
cmap=cmap)
48-
plt.colorbar()
49-
plt.title('contourf with levels')
50-
43+
cf = ax1.contourf(x[:-1, :-1] + dx/2.,
44+
y[:-1, :-1] + dy/2., z, levels=levels,
45+
cmap=cmap)
46+
fig.colorbar(cf, ax=ax1)
47+
ax1.set_title('contourf with levels')
48+
49+
# adjust spacing between subplots so `ax1` title and `ax0` tick labels
50+
# don't overlap
51+
fig.tight_layout()
5152

5253
plt.show()

examples/images_contours_and_fields/streamplot_demo_features.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
V = 1 + X - Y**2
1717
speed = np.sqrt(U*U + V*V)
1818

19-
plt.streamplot(X, Y, U, V, color=U, linewidth=2, cmap=plt.cm.autumn)
20-
plt.colorbar()
19+
fig0, ax0 = plt.subplots()
20+
strm = ax0.streamplot(X, Y, U, V, color=U, linewidth=2, cmap=plt.cm.autumn)
21+
fig0.colorbar(strm.lines)
2122

22-
f, (ax1, ax2) = plt.subplots(ncols=2)
23+
fig1, (ax1, ax2) = plt.subplots(ncols=2)
2324
ax1.streamplot(X, Y, U, V, density=[0.5, 1])
2425

25-
lw = 5*speed/speed.max()
26+
lw = 5*speed / speed.max()
2627
ax2.streamplot(X, Y, U, V, density=0.6, color='k', linewidth=lw)
2728

2829
plt.show()

0 commit comments

Comments
 (0)