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

Skip to content

Commit 86d0803

Browse files
committed
Merge remote-tracking branch 'upstream/v1.3.x'
Conflicts: lib/matplotlib/__init__.py
2 parents 1184f78 + 3706013 commit 86d0803

17 files changed

+173
-79
lines changed

distribute_setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def quote(arg):
4949
args = [quote(arg) for arg in args]
5050
return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
5151

52+
MINIMUM_VERSION = "0.6.28"
5253
DEFAULT_VERSION = "0.6.45"
5354
DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
5455
SETUPTOOLS_FAKED_VERSION = "0.6c11"
@@ -135,7 +136,7 @@ def _do_download(version, download_base, to_dir, download_delay):
135136
setuptools.bootstrap_install_from = egg
136137

137138

138-
def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
139+
def use_setuptools(version=MINIMUM_VERSION, download_base=DEFAULT_URL,
139140
to_dir=os.curdir, download_delay=15, no_fake=True):
140141
# making sure we use the absolute path
141142
to_dir = os.path.abspath(to_dir)

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
# General substitutions.
6060
project = 'Matplotlib'
61-
copyright = '2013 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the matplotlib development team'
61+
copyright = '2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the matplotlib development team; 2012 - 2013 The matplotlib development team'
6262

6363
# The default replacements for |version| and |release|, also used in various
6464
# other places throughout the built documents.

doc/devel/documenting_mpl.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ An example save command to generate a movie looks like this
351351

352352
ani.save('double_pendulum.mp4', fps=15)
353353

354-
Contact John Hunter for the login password to upload youtube videos of
354+
Contact Michael Droettboom for the login password to upload youtube videos of
355355
google docs to the mplgithub account.
356356

357357
.. _referring-to-mpl-docs:

doc/make.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,19 @@ def all():
236236
os.chdir(os.path.dirname(os.path.join(current_dir, __file__)))
237237
copy_if_out_of_date('../INSTALL', 'users/installing.rst')
238238

239+
# Create the examples symlink, if it doesn't exist
240+
241+
required_symlinks = [
242+
('mpl_examples', '../examples/'),
243+
('mpl_toolkits/axes_grid/examples', '../../../examples/axes_grid/')
244+
]
245+
246+
for link, target in required_symlinks:
247+
if not os.path.exists(link):
248+
if hasattr(os, 'symlink'):
249+
os.symlink(target, link)
250+
else:
251+
shutil.copytree(os.path.join(link, '..', target), link)
239252

240253
if len(sys.argv)>1:
241254
if '--small' in sys.argv[1:]:

doc/users/license.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,86 @@ licenses. Non-BSD compatible licenses (eg LGPL) are acceptable in
1313
matplotlib toolkits. For a discussion of the motivations behind the
1414
licencing choice, see :ref:`license-discussion`.
1515

16+
Copyright Policy
17+
================
18+
19+
John Hunter began matplotlib around 2003. Since shortly before his
20+
passing in 2012, Michael Droettboom has been the lead maintainer of
21+
matplotlib, but, as has always been the case, matplotlib is the work
22+
of many.
23+
24+
Prior to July of 2013, and the 1.3.0 release, the copyright of the
25+
source code was held by John Hunter. As of July 2013, and the 1.3.0
26+
release, matplotlib has moved to a shared copyright model.
27+
28+
matplotlib uses a shared copyright model. Each contributor maintains
29+
copyright over their contributions to matplotlib. But, it is important to
30+
note that these contributions are typically only changes to the
31+
repositories. Thus, the matplotlib source code, in its entirety, is not
32+
the copyright of any single person or institution. Instead, it is the
33+
collective copyright of the entire matplotlib Development Team. If
34+
individual contributors want to maintain a record of what
35+
changes/contributions they have specific copyright on, they should
36+
indicate their copyright in the commit message of the change, when
37+
they commit the change to one of the matplotlib repositories.
38+
39+
The Matplotlib Development Team is the set of all contributors to the
40+
matplotlib project. A full list can be obtained from the git version
41+
control logs.
1642

1743
License agreement for matplotlib |version|
1844
==============================================
1945

46+
1. This LICENSE AGREEMENT is between the Matplotlib Development Team
47+
("MDT"), and the Individual or Organization ("Licensee") accessing and
48+
otherwise using matplotlib software in source or binary form and its
49+
associated documentation.
50+
51+
. Subject to the terms and conditions of this License Agreement, MDT
52+
hereby grants Licensee a nonexclusive, royalty-free, world-wide license
53+
to reproduce, analyze, test, perform and/or display publicly, prepare
54+
derivative works, distribute, and otherwise use matplotlib |version|
55+
alone or in any derivative version, provided, however, that MDT's
56+
License Agreement and MDT's notice of copyright, i.e., "Copyright (c)
57+
2012-2013 Matplotlib Development Team; All Rights Reserved" are retained in
58+
matplotlib |version| alone or in any derivative version prepared by
59+
Licensee.
60+
61+
3. In the event Licensee prepares a derivative work that is based on or
62+
incorporates matplotlib |version| or any part thereof, and wants to
63+
make the derivative work available to others as provided herein, then
64+
Licensee hereby agrees to include in any such work a brief summary of
65+
the changes made to matplotlib |version|.
66+
67+
4. MDT is making matplotlib |version| available to Licensee on an "AS
68+
IS" basis. MDT MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
69+
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, MDT MAKES NO AND
70+
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
71+
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB |version|
72+
WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
73+
74+
5. MDT SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB
75+
|version| FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
76+
LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING
77+
MATPLOTLIB |version|, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF
78+
THE POSSIBILITY THEREOF.
79+
80+
6. This License Agreement will automatically terminate upon a material
81+
breach of its terms and conditions.
82+
83+
7. Nothing in this License Agreement shall be deemed to create any
84+
relationship of agency, partnership, or joint venture between MDT and
85+
Licensee. This License Agreement does not grant permission to use MDT
86+
trademarks or trade name in a trademark sense to endorse or promote
87+
products or services of Licensee, or any third party.
88+
89+
8. By copying, installing or otherwise using matplotlib |version|,
90+
Licensee agrees to be bound by the terms and conditions of this License
91+
Agreement.
92+
93+
License agreement for matplotlib versions prior to 1.3.0
94+
========================================================
95+
2096
1. This LICENSE AGREEMENT is between John D. Hunter ("JDH"), and the
2197
Individual or Organization ("Licensee") accessing and otherwise using
2298
matplotlib software in source or binary form and its associated

lib/matplotlib/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -718,11 +718,11 @@ def matplotlib_fname():
718718
fname == os.path.join(
719719
get_home(), '.matplotlib', 'matplotlibrc')):
720720
warnings.warn(
721-
"Found matplotlib configuration in ~/.matplotlib. "
721+
"Found matplotlib configuration in ~/.matplotlib/. "
722722
"To conform with the XDG base directory standard, "
723723
"this configuration location has been deprecated "
724-
"on Linux, and the new location is now %r. Please "
725-
"move your configuration there to ensure that "
724+
"on Linux, and the new location is now %r/matplotlib/. "
725+
"Please move your configuration there to ensure that "
726726
"matplotlib will continue to find it in the future." %
727727
_get_xdg_config_dir())
728728
return fname

lib/matplotlib/afm.py

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
"""
22
This is a python interface to Adobe Font Metrics Files. Although a
3-
number of other python implementations exist (and may be more complete
4-
than mine) I decided not to go with them because either they were
5-
either
3+
number of other python implementations exist, and may be more complete
4+
than this, it was decided not to go with them because they were
5+
either:
66
77
1) copyrighted or used a non-BSD compatible license
88
9-
2) had too many dependencies and I wanted a free standing lib
9+
2) had too many dependencies and a free standing lib was needed
1010
11-
3) Did more than I needed and it was easier to write my own than
12-
figure out how to just get what I needed from theirs
11+
3) Did more than needed and it was easier to write afresh rather than
12+
figure out how to get just what was needed.
1313
14-
It is pretty easy to use, and requires only built-in python libs::
14+
It is pretty easy to use, and requires only built-in python libs:
1515
16-
>>> from afm import AFM
17-
>>> fh = open('ptmr8a.afm')
18-
>>> afm = AFM(fh)
16+
>>> from matplotlib import rcParams
17+
>>> import os.path
18+
>>> afm_fname = os.path.join(rcParams['datapath'],
19+
... 'fonts', 'afm', 'ptmr8a.afm')
20+
>>>
21+
>>> from matplotlib.afm import AFM
22+
>>> afm = AFM(open(afm_fname))
1923
>>> afm.string_width_height('What the heck?')
20-
(6220.0, 683)
24+
(6220.0, 694)
2125
>>> afm.get_fontname()
2226
'Times-Roman'
2327
>>> afm.get_kern_dist('A', 'f')
@@ -26,12 +30,7 @@
2630
-92.0
2731
>>> afm.get_bbox_char('!')
2832
[130, -9, 238, 676]
29-
>>> afm.get_bbox_font()
30-
[-168, -218, 1000, 898]
3133
32-
33-
AUTHOR:
34-
John D. Hunter <[email protected]>
3534
"""
3635

3736
from __future__ import print_function
@@ -549,14 +548,4 @@ def get_vertical_stem_width(self):
549548
Return the standard vertical stem width as float, or *None* if
550549
not specified in AFM file.
551550
"""
552-
return self._header.get(b'StdVW', None)
553-
554-
555-
if __name__ == '__main__':
556-
#pathname = '/usr/local/lib/R/afm/'
557-
pathname = '/usr/local/share/fonts/afms/adobe'
558-
559-
for fname in os.listdir(pathname):
560-
with open(os.path.join(pathname, fname)) as fh:
561-
afm = AFM(fh)
562-
w, h = afm.string_width_height('John Hunter is the Man!')
551+
return self._header.get(b'StdVW', None)

lib/matplotlib/backends/backend_wxagg.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
"""
2-
3-
backend_wxagg.py
4-
5-
A wxPython backend for Agg. This uses the GUI widgets written by
6-
Jeremy O'Donoghue ([email protected]) and the Agg backend by John
7-
8-
9-
Copyright (C) 2003-5 Jeremy O'Donoghue, John Hunter, Illinois Institute of
10-
Technology
11-
12-
13-
License: This work is licensed under the matplotlib license( PSF
14-
compatible). A copy should be included with this source code.
15-
16-
"""
17-
181
from __future__ import division, print_function
192
import matplotlib
203
from matplotlib.figure import Figure
@@ -26,6 +9,7 @@
269
draw_if_interactive, show, Toolbar, backend_version
2710
import wx
2811

12+
2913
class FigureFrameWxAgg(FigureFrameWx):
3014
def get_canvas(self, fig):
3115
return FigureCanvasWxAgg(self, -1, fig)
@@ -40,6 +24,7 @@ def _get_toolbar(self, statbar):
4024
toolbar = None
4125
return toolbar
4226

27+
4328
class FigureCanvasWxAgg(FigureCanvasAgg, FigureCanvasWx):
4429
"""
4530
The FigureCanvas contains the figure and does event handling.
@@ -105,6 +90,7 @@ def print_figure(self, filename, *args, **kwargs):
10590
if self._isDrawn:
10691
self.draw()
10792

93+
10894
class NavigationToolbar2WxAgg(NavigationToolbar2Wx):
10995
def get_canvas(self, frame, fig):
11096
return FigureCanvasWxAgg(frame, -1, fig)
@@ -200,5 +186,4 @@ def _WX28_clipped_agg_as_bitmap(agg, bbox):
200186
srcDC.SelectObject(wx.NullBitmap)
201187
destDC.SelectObject(wx.NullBitmap)
202188

203-
return destBmp
204-
189+
return destBmp

lib/matplotlib/cbook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ class Grouper(object):
16171617
>>> grp.join(b, c)
16181618
>>> grp.join(d, e)
16191619
>>> sorted(map(tuple, grp))
1620-
[(d, e), (a, b, c)]
1620+
[(a, b, c), (d, e)]
16211621
>>> grp.joined(a, b)
16221622
True
16231623
>>> grp.joined(a, c)

lib/matplotlib/offsetbox.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717

1818
from __future__ import print_function
19+
import warnings
1920
import matplotlib.transforms as mtransforms
2021
import matplotlib.artist as martist
2122
import matplotlib.text as mtext
@@ -1098,6 +1099,12 @@ def __init__(self, s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs):
10981099
other keyword parameters of AnchoredOffsetbox are also allowed.
10991100
"""
11001101

1102+
propkeys = prop.keys()
1103+
badkwargs = ('ha', 'horizontalalignment', 'va', 'verticalalignment')
1104+
if set(badkwargs) & set(propkeys):
1105+
warnings.warn("Mixing horizontalalignment or verticalalignment "
1106+
"with AnchoredText is not supported.")
1107+
11011108
self.txt = TextArea(s, textprops=prop,
11021109
minimumdescent=False)
11031110
fp = self.txt._text.get_fontproperties()

lib/matplotlib/stackplot.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ def stackplot(axes, x, *args, **kwargs):
4343
Returns *r* : A list of
4444
:class:`~matplotlib.collections.PolyCollection`, one for each
4545
element in the stacked area plot.
46+
47+
Note that :class:`~matplotlib.legend.Legend` does not support
48+
:class:`~matplotlib.collections.PolyCollection` objects. To create a
49+
legend on a stackplot, use a proxy artist:
50+
http://matplotlib.org/users/legend_guide.html#using-proxy-artist
4651
"""
4752

4853
if len(args) == 1:

lib/matplotlib/tests/test_contour.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from matplotlib.testing.decorators import cleanup, image_comparison
66
from matplotlib import pyplot as plt
77

8+
import re
9+
810

911
@cleanup
1012
def test_contour_shape_1d_valid():
@@ -99,14 +101,18 @@ def test_contour_shape_mismatch_4():
99101
ax.contour(b, g, z)
100102
except TypeError as exc:
101103
print exc.args[0]
102-
assert exc.args[0] == 'Shape of x does not match that of z: ' + \
103-
'found (9, 9) instead of (9, 10).'
104+
assert re.match(
105+
r'Shape of x does not match that of z: ' +
106+
r'found \(9L?, 9L?\) instead of \(9L?, 10L?\)\.',
107+
exc.args[0]) is not None
104108

105109
try:
106110
ax.contour(g, b, z)
107111
except TypeError as exc:
108-
assert exc.args[0] == 'Shape of y does not match that of z: ' + \
109-
'found (9, 9) instead of (9, 10).'
112+
assert re.match(
113+
r'Shape of y does not match that of z: ' +
114+
r'found \(9L?, 9L?\) instead of \(9L?, 10L?\)\.',
115+
exc.args[0]) is not None
110116

111117

112118
@cleanup
@@ -159,23 +165,23 @@ def test_given_colors_levels_and_extends():
159165
_, axes = plt.subplots(2, 4)
160166

161167
data = np.arange(12).reshape(3, 4)
162-
168+
163169
colors = ['red', 'yellow', 'pink', 'blue', 'black']
164170
levels = [2, 4, 8, 10]
165-
171+
166172
for i, ax in enumerate(axes.flatten()):
167173
plt.sca(ax)
168-
174+
169175
filled = i % 2 == 0.
170176
extend = ['neither', 'min', 'max', 'both'][i // 2]
171-
177+
172178
if filled:
173179
last_color = -1 if extend in ['min', 'max'] else None
174180
plt.contourf(data, colors=colors[:last_color], levels=levels, extend=extend)
175181
else:
176182
last_level = -1 if extend == 'both' else None
177183
plt.contour(data, colors=colors, levels=levels[:last_level], extend=extend)
178-
184+
179185
plt.colorbar()
180186

181187

lib/matplotlib/tests/test_simplification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def test_start_with_moveto():
152152
verts = np.fromstring(decodebytes(data), dtype='<i4')
153153
verts = verts.reshape((len(verts) / 2, 2))
154154
path = Path(verts)
155-
segs = path.iter_segments(transforms.IdentityTransform, clip=(0.0, 0.0, 100.0, 100.0))
155+
segs = path.iter_segments(transforms.IdentityTransform(), clip=(0.0, 0.0, 100.0, 100.0))
156156
segs = list(segs)
157157
assert len(segs) == 1
158158
assert segs[0][1] == Path.MOVETO

0 commit comments

Comments
 (0)