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

Skip to content

Commit 4e97a1c

Browse files
committed
syncing for 82
svn path=/trunk/matplotlib/; revision=1471
1 parent ef8e81e commit 4e97a1c

7 files changed

Lines changed: 64 additions & 29 deletions

File tree

LICENSE/LICENSE

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
LICENSE AGREEMENT FOR MATPLOTLIB 0.81
1+
LICENSE AGREEMENT FOR MATPLOTLIB 0.82
22
--------------------------------------
33

44
1. This LICENSE AGREEMENT is between John D. Hunter ("JDH"), and the
@@ -9,30 +9,30 @@ documentation.
99
2. Subject to the terms and conditions of this License Agreement, JDH
1010
hereby grants Licensee a nonexclusive, royalty-free, world-wide license
1111
to reproduce, analyze, test, perform and/or display publicly, prepare
12-
derivative works, distribute, and otherwise use matplotlib 0.81
12+
derivative works, distribute, and otherwise use matplotlib 0.82
1313
alone or in any derivative version, provided, however, that JDH's
1414
License Agreement and JDH's notice of copyright, i.e., "Copyright (c)
1515
2002-2005 John D. Hunter; All Rights Reserved" are retained in
16-
matplotlib 0.81 alone or in any derivative version prepared by
16+
matplotlib 0.82 alone or in any derivative version prepared by
1717
Licensee.
1818

1919
3. In the event Licensee prepares a derivative work that is based on or
20-
incorporates matplotlib 0.81 or any part thereof, and wants to
20+
incorporates matplotlib 0.82 or any part thereof, and wants to
2121
make the derivative work available to others as provided herein, then
2222
Licensee hereby agrees to include in any such work a brief summary of
23-
the changes made to matplotlib 0.81.
23+
the changes made to matplotlib 0.82.
2424

25-
4. JDH is making matplotlib 0.81 available to Licensee on an "AS
25+
4. JDH is making matplotlib 0.82 available to Licensee on an "AS
2626
IS" basis. JDH MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
2727
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, JDH MAKES NO AND
2828
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
29-
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 0.81
29+
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 0.82
3030
WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
3131

3232
5. JDH SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB
33-
0.81 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
33+
0.82 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
3434
LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING
35-
MATPLOTLIB 0.81, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF
35+
MATPLOTLIB 0.82, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF
3636
THE POSSIBILITY THEREOF.
3737

3838
6. This License Agreement will automatically terminate upon a material
@@ -44,6 +44,6 @@ Licensee. This License Agreement does not grant permission to use JDH
4444
trademarks or trade name in a trademark sense to endorse or promote
4545
products or services of Licensee, or any third party.
4646

47-
8. By copying, installing or otherwise using matplotlib 0.81,
47+
8. By copying, installing or otherwise using matplotlib 0.82,
4848
Licensee agrees to be bound by the terms and conditions of this License
4949
Agreement.

examples/dynamic_demo_wx.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
2121
Modification History:
2222
$Log$
23+
Revision 1.7 2005/06/15 20:24:56 jdh2358
24+
syncing for 82
25+
2326
Revision 1.6 2004/10/26 18:08:13 astraw
2427
Converted to use new NavigationToolbar2 (from old Toolbar).
2528
@@ -95,7 +98,7 @@ def __init__(self):
9598
EVT_TIMER(self, TIMER_ID, self.onTimer)
9699

97100
def init_plot_data(self):
98-
a = self.figmgr.add_subplot(111)
101+
a = self.fig.add_subplot(111)
99102
self.ind = numpy.arange(60)
100103
tmp = []
101104
for i in range(60):

examples/ganged_plots.py

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python
22
"""
3-
To create plots that share a common axes (visually) you need to set
4-
the axes locations manually by supplying the appropriate axes
5-
rectangles. Normally you'll want to turn off the tick labels on all
6-
but one of the axes.
3+
To create plots that share a common axes (visually) you can set the
4+
hspace bewtween the subplots close to zero (do not use zero itself).
5+
Normally you'll want to turn off the tick labels on all but one of the
6+
axes.
77
88
In this example the plots share a common xaxis but you can follow the
99
same logic to supply a common y axis.
@@ -18,15 +18,28 @@
1818

1919
# axes rect in relative 0,1 coords left, bottom, width, height. Turn
2020
# off xtick labels on all but the lower plot
21-
ax1 = axes([0.1, 0.1, 0.8, 0.25]) # lower
22-
ax2 = axes([0.1, 0.35, 0.8, 0.25], sharex=ax1) # middle
23-
setp(ax2.get_xticklabels(), visible=False)
24-
ax3 = axes([0.1, 0.6, 0.8, 0.25], sharex=ax1) # upper
25-
setp(ax3.get_xticklabels(), visible=False)
2621

2722

23+
f = figure()
24+
subplots_adjust(hspace=0.001)
25+
26+
27+
ax1 = subplot(311)
2828
ax1.plot(t,s1)
29+
yticks(arange(-0.9, 1.0, 0.4))
30+
ylim(-1,1)
31+
32+
ax2 = subplot(312, sharex=ax1)
2933
ax2.plot(t,s2)
34+
yticks(arange(0.1, 1.0, 0.2))
35+
ylim(0,1)
36+
37+
ax3 = subplot(313, sharex=ax1)
3038
ax3.plot(t,s3)
39+
yticks(arange(-0.9, 1.0, 0.4))
40+
ylim(-1,1)
41+
42+
xticklabels = ax1.get_xticklabels()+ax2.get_xticklabels()
43+
setp(xticklabels, visible=False)
3144

3245
show()

examples/histogram_demo_canvasagg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from matplotlib.figure import Figure
1414
from matplotlib.axes import Subplot
1515
from matplotlib.mlab import normpdf
16-
from matplotlib.numerix import randn
16+
from matplotlib.numerix.mlab import randn
1717

1818
fig = Figure(figsize=(5,4), dpi=100)
1919
ax = fig.add_subplot(111)

examples/widgets/sliders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def update(val):
2323
sfreq.on_changed(update)
2424
samp.on_changed(update)
2525

26-
resetax = axes([0.8, 0.01, 0.1, 0.05])
26+
resetax = axes([0.8, 0.025, 0.1, 0.04])
2727
button = Button(resetax, 'Reset')
2828

2929
def reset(event):

lib/matplotlib/axes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3641,11 +3641,13 @@ def dist(a):
36413641
return dist_x_y(xywin, asarray(xt), asarray(yt))
36423642

36433643
artists = self.lines + self.patches + self.texts
3644-
if among is not None and callable(among):
3644+
if callable(among):
36453645
artists = filter(test, artists)
36463646
elif iterable(among):
36473647
amongd = dict([(k,1) for k in among])
36483648
artists = [a for a in artists if a in amongd]
3649+
elif among is None:
3650+
pass
36493651
else:
36503652
raise ValueError('among mut be callable or iterable')
36513653
if not len(artists): return None

lib/matplotlib/figure.py

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,25 @@ def delaxes(self, a):
327327
for func in self._axobservers: func(self)
328328

329329

330+
331+
def _make_key(self, *args, **kwargs):
332+
'make a hashable key out of args and kwargs'
333+
334+
def fixitems(items):
335+
#items may have arrays and lists in them, so convert them
336+
# to tuples for the kyey
337+
ret = []
338+
for k, v in items:
339+
if iterable(v): v = tuple(v)
340+
ret.append((k,v))
341+
return ret
342+
343+
if iterable(args[0]):
344+
key = tuple(args[0]), tuple( fixitems(kwargs.items()))
345+
else:
346+
key = args[0], tuple(fixitems( kwargs.items()))
347+
return key
348+
330349
def add_axes(self, *args, **kwargs):
331350
"""
332351
Add an a axes with axes rect [left, bottom, width, height] where all
@@ -353,10 +372,7 @@ def add_axes(self, *args, **kwargs):
353372
The Axes instance will be returned
354373
"""
355374

356-
if iterable(args[0]):
357-
key = tuple(args[0]), tuple(kwargs.items())
358-
else:
359-
key = args[0], tuple(kwargs.items())
375+
key = self._make_key(*args, **kwargs)
360376

361377
if self._seen.has_key(key):
362378
ax = self._seen[key]
@@ -398,8 +414,9 @@ def add_subplot(self, *args, **kwargs):
398414
If the figure already has a subplot with key *args, *kwargs then it will
399415
simply make that subplot current and return it
400416
"""
401-
402-
key = args, tuple(kwargs.items())
417+
418+
key = self._make_key(*args, **kwargs)
419+
403420
if self._seen.has_key(key):
404421
ax = self._seen[key]
405422
self.sca(ax)

0 commit comments

Comments
 (0)