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

Skip to content

Commit f7f18c4

Browse files
committed
Merge remote-tracking branch 'upstream/master' into stackplot_6313
2 parents 506df7b + c227b14 commit f7f18c4

File tree

136 files changed

+707
-411
lines changed

Some content is hidden

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

136 files changed

+707
-411
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ John Hunter <[email protected]>
2828
Jorrit Wronski <[email protected]>
2929
Jouni K. Seppänen <[email protected]>
3030
Joseph Fox-Rabinovitz <[email protected]> Mad Physicist <[email protected]>
31+
Joseph Fox-Rabinovitz <[email protected]> Joseph Fox-Rabinovitz <[email protected]>
3132
3233
3334

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ script:
139139
deactivate
140140
source ~/virtualenv/python2.7/bin/activate
141141
pip install pip --upgrade
142-
pip install linkchecker
142+
# linkchecker is currently broken with requests 2.10.0 so force an earlier version
143+
pip install $PRE requests==2.9.2 linkchecker
143144
linkchecker build/html/index.html
144145
fi
145146
- rm -rf $HOME/.cache/matplotlib/tex.cache

INSTALL

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,13 @@ Required Dependencies
212212
Used to manipulate time-zone aware datetimes. http://pypi.python.org/pypi/pytz
213213

214214
:term:`FreeType` 2.3 or later
215-
Library for reading true type font files. If using pip, easy_install or
215+
Library for reading true type font files. If using pip, easy_install or
216216
installing from source, the installer will attempt to locate FreeType in
217-
expected locations. If it cannot, try installing `pkg-config
217+
expected locations. If it cannot, try installing `pkg-config
218218
<http://matplotlib.org/users/installing.html#optional-dependencies>`__,
219219
a tool used to find required non-python libraries.
220220

221-
`cycler <http://matplotlib.org/cycler/>`__ 0.9 or later
221+
`cycler <http://matplotlib.org/cycler/>`__ 0.10.0 or later
222222
Composable cycle class used for constructing style-cycles
223223

224224
`functools32`

doc/thirdpartypackages/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,7 @@ mplstereonet
165165
===============
166166

167167
`mplstereonet <https://github.com/joferkington/mplstereonet>`_ provides stereonets for plotting and analyzing orientation data in Matplotlib.
168+
169+
pyupset
170+
===============
171+
`pyUpSet <https://github.com/ImSoErgodic/py-upset>`_ is a static Python implementation of the `UpSet suite by Lex et al. <http://www.caleydo.org/tools/upset/>`_ to explore complex intersections of sets and data frames.

doc/users/whats_new/rcparams.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Configuration (rcParams)
1616
+----------------------------+--------------------------------------------------+
1717
|`date.autoformatter.second` | format string for 'second' scale times |
1818
+----------------------------+--------------------------------------------------+
19+
|`scatter.marker` | default marker for scatter plot |
20+
+----------------------------+--------------------------------------------------+
1921
|`svg.hashsalt` | see note |
2022
+----------------------------+--------------------------------------------------+
2123

doc/users/whats_new/uptade_subplot2grid.rst renamed to doc/users/whats_new/update_subplot2grid.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
New Firgure Parameter for subplot2grid
1+
New Figure Parameter for subplot2grid
22
--------------------------------------
33

44
A ``fig`` parameter now exists for the method :func:`subplot2grid`. This allows
5-
for the figure that the subplots will be created in to be specified. If ``fig``
5+
a user to specify the figure where the subplots will be created. If ``fig``
66
is ``None`` (default) then the method will use the current figure retrieved by
77
:func:`gcf`.
88

examples/animation/dynamic_image.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python
21
"""
32
An animated image
43
"""

examples/animation/dynamic_image2.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python
21
"""
32
An animated image
43
"""

examples/api/agg_oo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python
21
# -*- noplot -*-
32
"""
43
A pure OO (look Ma, no pylab!) example using the agg backend

examples/api/barchart_demo.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
#!/usr/bin/env python
31
# a bar plot with errorbars
42
import numpy as np
53
import matplotlib.pyplot as plt

examples/api/collections_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python
21
'''Demonstration of LineCollection, PolyCollection, and
32
RegularPolyCollection with autoscaling.
43

examples/api/date_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python
21
"""
32
Show how to make date plots in matplotlib using date tick locators and
43
formatters. See major_minor_demo1.py for more information on

examples/api/joinstyle.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python
21
"""
32
Illustrate the three different join styles
43
"""

examples/api/power_norm_demo.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/python
2-
31
from matplotlib import pyplot as plt
42
import matplotlib.colors as mcolors
53
import numpy as np

examples/api/sankey_demo_old.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
from __future__ import print_function
42

53
__author__ = "Yannick Copin <[email protected]>"

examples/api/two_scales.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python
21
"""
32
43
Demonstrate how to do two plots on the same axes with different left

examples/event_handling/keypress_demo.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
"""
42
Show how to connect to keypress events
53
"""

examples/event_handling/pick_event_demo.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
"""
42
53
You can enable picking by setting the "picker" property of an artist

examples/event_handling/pipong.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python
21
# A matplotlib based game of Pong illustrating one way to write interactive
32
# animation which are easily ported to multiple backends
43
# pipong.py was written by Paul Ivanov <http://pirsquared.org>

examples/event_handling/pong_gtk.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
from __future__ import print_function
42

53
# For detailed comments on animation and the techniques used here, see

examples/event_handling/test_mouseclicks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python
21
from __future__ import print_function
32

43
import matplotlib

examples/misc/ftface_props.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
from __future__ import print_function
42
"""
53
This is a demo script to show you how to use all the properties of an
Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,42 @@
1+
'''
2+
Demonstrates using ax.plot's zdir keyword to plot 2D scatterplot data on
3+
selective axes of a 3D plot.
4+
'''
5+
16
from mpl_toolkits.mplot3d import Axes3D
27
import numpy as np
38
import matplotlib.pyplot as plt
49

510
fig = plt.figure()
611
ax = fig.gca(projection='3d')
712

13+
# Plot a sin curve using the x and y axes.
814
x = np.linspace(0, 1, 100)
915
y = np.sin(x * 2 * np.pi) / 2 + 0.5
10-
ax.plot(x, y, zs=0, zdir='z', label='zs=0, zdir=z')
16+
ax.plot(x, y, zs=0, zdir='z', label='curve in (x,y)')
1117

18+
# Plot scatterplot data (20 2D points per colour) on the x and z axes.
1219
colors = ('r', 'g', 'b', 'k')
20+
x = np.random.sample(20*len(colors))
21+
y = np.random.sample(20*len(colors))
22+
c_list = []
1323
for c in colors:
14-
x = np.random.sample(20)
15-
y = np.random.sample(20)
16-
ax.scatter(x, y, 0, zdir='y', c=c)
24+
c_list.append([c]*20)
25+
# By using zdir='y', the y value of these points is fixed to the zs value 0
26+
# and the (x,y) points are plotted on the x and z axes.
27+
ax.scatter(x, y, zs=0, zdir='y', c=c_list, label='points in (x,z)')
1728

29+
# Make legend, set axes limits and labels
1830
ax.legend()
1931
ax.set_xlim3d(0, 1)
2032
ax.set_ylim3d(0, 1)
2133
ax.set_zlim3d(0, 1)
34+
ax.set_xlabel('X')
35+
ax.set_ylabel('Y')
36+
ax.set_zlabel('Z')
37+
38+
# Customize the view angle so it's easier to see that the scatter points lie
39+
# on the plane y=0
40+
ax.view_init(elev=20., azim=-35)
2241

2342
plt.show()

examples/mplot3d/bars3d_demo.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,35 @@
1+
'''
2+
Demonstrates making a 3D plot which has 2D bar graphs projected onto
3+
planes y=0, y=1, etc.
4+
'''
5+
16
from mpl_toolkits.mplot3d import Axes3D
27
import matplotlib.pyplot as plt
38
import numpy as np
49

510
fig = plt.figure()
611
ax = fig.add_subplot(111, projection='3d')
7-
for c, z in zip(['r', 'g', 'b', 'y'], [30, 20, 10, 0]):
12+
13+
colors = ['r', 'g', 'b', 'y']
14+
yticks = [3, 2, 1, 0]
15+
for c, k in zip(colors, yticks):
16+
# Generate the random data for the y=k 'layer'.
817
xs = np.arange(20)
918
ys = np.random.rand(20)
1019

11-
# You can provide either a single color or an array. To demonstrate this,
12-
# the first bar of each set will be colored cyan.
20+
# You can provide either a single color or an array with the same length as
21+
# xs and ys. To demonstrate this, we color the first bar of each set cyan.
1322
cs = [c] * len(xs)
1423
cs[0] = 'c'
15-
ax.bar(xs, ys, zs=z, zdir='y', color=cs, alpha=0.8)
24+
25+
# Plot the bar graph given by xs and ys on the plane y=k with 80% opacity.
26+
ax.bar(xs, ys, zs=k, zdir='y', color=cs, alpha=0.8)
1627

1728
ax.set_xlabel('X')
1829
ax.set_ylabel('Y')
1930
ax.set_zlabel('Z')
2031

32+
# On the y axis let's only label the discrete values that we have data for.
33+
ax.set_yticks(yticks)
34+
2135
plt.show()

examples/mplot3d/contour3d_demo.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1+
'''
2+
Demonstrates plotting contour (level) curves in 3D.
3+
4+
This is like a contour plot in 2D except that the f(x,y)=c curve is plotted
5+
on the plane z=c.
6+
'''
7+
18
from mpl_toolkits.mplot3d import axes3d
29
import matplotlib.pyplot as plt
310
from matplotlib import cm
411

512
fig = plt.figure()
6-
ax = fig.add_subplot(111, projection='3d')
13+
ax = fig.gca(projection='3d')
714
X, Y, Z = axes3d.get_test_data(0.05)
15+
16+
# Plot contour curves
817
cset = ax.contour(X, Y, Z, cmap=cm.coolwarm)
18+
919
ax.clabel(cset, fontsize=9, inline=1)
1020

1121
plt.show()

examples/mplot3d/contour3d_demo2.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1+
'''
2+
Demonstrates plotting contour (level) curves in 3D using the extend3d option.
3+
4+
This modification of the contour3d_demo example uses extend3d=True to
5+
extend the curves vertically into 'ribbons'.
6+
'''
7+
18
from mpl_toolkits.mplot3d import axes3d
29
import matplotlib.pyplot as plt
310
from matplotlib import cm
411

512
fig = plt.figure()
613
ax = fig.gca(projection='3d')
714
X, Y, Z = axes3d.get_test_data(0.05)
15+
816
cset = ax.contour(X, Y, Z, extend3d=True, cmap=cm.coolwarm)
17+
918
ax.clabel(cset, fontsize=9, inline=1)
1019

1120
plt.show()

examples/mplot3d/contour3d_demo3.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
1+
'''
2+
Demonstrates displaying a 3D surface while also projecting contour 'profiles'
3+
onto the 'walls' of the graph.
4+
5+
See contourf3d_demo2 for the filled version.
6+
'''
7+
18
from mpl_toolkits.mplot3d import axes3d
29
import matplotlib.pyplot as plt
310
from matplotlib import cm
411

512
fig = plt.figure()
613
ax = fig.gca(projection='3d')
714
X, Y, Z = axes3d.get_test_data(0.05)
15+
16+
# Plot the 3D surface
817
ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3)
18+
19+
# Plot projections of the contours for each dimension. By choosing offsets
20+
# that match the appropriate axes limits, the projected contours will sit on
21+
# the 'walls' of the graph
922
cset = ax.contour(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm)
1023
cset = ax.contour(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm)
1124
cset = ax.contour(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm)
1225

13-
ax.set_xlabel('X')
1426
ax.set_xlim(-40, 40)
15-
ax.set_ylabel('Y')
1627
ax.set_ylim(-40, 40)
17-
ax.set_zlabel('Z')
1828
ax.set_zlim(-100, 100)
1929

30+
ax.set_xlabel('X')
31+
ax.set_ylabel('Y')
32+
ax.set_zlabel('Z')
33+
2034
plt.show()

examples/mplot3d/contourf3d_demo.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1+
'''
2+
contourf differs from contour in that it creates filled contours, ie.
3+
a discrete number of colours are used to shade the domain.
4+
5+
This is like a contourf plot in 2D except that the shaded region corresponding
6+
to the level c is graphed on the plane z=c.
7+
'''
8+
19
from mpl_toolkits.mplot3d import axes3d
210
import matplotlib.pyplot as plt
311
from matplotlib import cm
412

513
fig = plt.figure()
614
ax = fig.gca(projection='3d')
715
X, Y, Z = axes3d.get_test_data(0.05)
16+
817
cset = ax.contourf(X, Y, Z, cmap=cm.coolwarm)
18+
919
ax.clabel(cset, fontsize=9, inline=1)
1020

1121
plt.show()

examples/mplot3d/contourf3d_demo2.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
"""
2-
.. versionadded:: 1.1.0
3-
This demo depends on new features added to contourf3d.
4-
"""
1+
'''
2+
Demonstrates displaying a 3D surface while also projecting filled contour
3+
'profiles' onto the 'walls' of the graph.
4+
5+
See contour3d_demo2 for the unfilled version.
6+
'''
57

68
from mpl_toolkits.mplot3d import axes3d
79
import matplotlib.pyplot as plt
@@ -10,16 +12,23 @@
1012
fig = plt.figure()
1113
ax = fig.gca(projection='3d')
1214
X, Y, Z = axes3d.get_test_data(0.05)
15+
16+
# Plot the 3D surface
1317
ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3)
18+
19+
# Plot projections of the contours for each dimension. By choosing offsets
20+
# that match the appropriate axes limits, the projected contours will sit on
21+
# the 'walls' of the graph
1422
cset = ax.contourf(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm)
1523
cset = ax.contourf(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm)
1624
cset = ax.contourf(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm)
1725

18-
ax.set_xlabel('X')
1926
ax.set_xlim(-40, 40)
20-
ax.set_ylabel('Y')
2127
ax.set_ylim(-40, 40)
22-
ax.set_zlabel('Z')
2328
ax.set_zlim(-100, 100)
2429

30+
ax.set_xlabel('X')
31+
ax.set_ylabel('Y')
32+
ax.set_zlabel('Z')
33+
2534
plt.show()

0 commit comments

Comments
 (0)