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

Skip to content

Commit 0b6033d

Browse files
committed
Merged revisions 4715-4725 via svnmerge from
http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r4718 | mdboom | 2007-12-13 08:40:40 -0500 (Thu, 13 Dec 2007) | 2 lines Updated to numpy names. ........ r4720 | jdh2358 | 2007-12-13 11:06:59 -0500 (Thu, 13 Dec 2007) | 2 lines moved optional rec2* packages out of mlab and into toolkits ........ r4722 | jdh2358 | 2007-12-13 13:12:11 -0500 (Thu, 13 Dec 2007) | 2 lines added gtktools and exceltools to toolkits ........ svn path=/branches/transforms/; revision=4727
2 parents 5b16012 + e16a414 commit 0b6033d

11 files changed

Lines changed: 447 additions & 377 deletions

File tree

API_CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ TRANSFORMS REFACTORING
169169

170170
END OF TRANSFORMS REFACTORING
171171

172+
Moved rec2gtk to matplotlib.toolkits.gtktools
173+
174+
Moved rec2excel to matplotlib.toolkits.exceltools
175+
172176
Removed, dead/experimental ExampleInfo, Namespace and Importer
173177
code from matplotlib/__init__.py
174178
0.91.1 Released

CODING_GUIDE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ noise in svn diffs. If you are an emacs user, the following in your
113113
.emacs will cause emacs to strip trailing white space on save for
114114
python, C and C++
115115

116+
117+
When importing modules from the matplotlib namespace
118+
119+
import matplotlib.cbook as cbook # DO
120+
from matplotlib import cbook #DONT
121+
122+
because the latter is ambiguous whether cbook is a module or a
123+
function to the new developer. The former makes it explcit that you
124+
are importing a module or package.
125+
116126
; and similarly for c++-mode-hook and c-mode-hook
117127
(add-hook 'python-mode-hook
118128
(lambda ()

examples/figimage_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
im1 = figimage(Z, xo=50, yo=0)
1414
im2 = figimage(Z, xo=100, yo=100, alpha=.8)
1515
#gray() # overrides current and sets default
16-
#savefig('figimage_demo')
16+
savefig('figimage_demo')
1717

1818
show()
1919

examples/logo.py

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

66
# convert data to mV
77
x = 1000*0.1*fromstring(
8-
file('data/membrane.dat', 'rb').read(), Float32)
8+
file('data/membrane.dat', 'rb').read(), float32)
99
# 0.0005 is the sample interval
1010
t = 0.0005*arange(len(x))
1111
figure(1, figsize=(7,1), dpi=100)

examples/mri_demo.py

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

44
# data are 256x256 16 bit integers
55
dfile = 'data/s1045.ima'
6-
im = fromstring(file(dfile, 'rb').read(), UInt16).astype(Float)
6+
im = fromstring(file(dfile, 'rb').read(), uint16).astype(float)
77
im.shape = 256, 256
88

99
#imshow(im, ColormapJet(256))

lib/matplotlib/image.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from matplotlib._image import *
2424

2525
class AxesImage(martist.Artist, cm.ScalarMappable):
26+
zorder = 1
2627

2728
def __init__(self, ax,
2829
cmap = None,
@@ -508,18 +509,21 @@ def set_alpha(self, alpha):
508509
self.update_dict['array'] = True
509510

510511
class FigureImage(martist.Artist, cm.ScalarMappable):
512+
zorder = 1
511513
def __init__(self, fig,
512514
cmap = None,
513515
norm = None,
514516
offsetx = 0,
515517
offsety = 0,
516518
origin=None,
519+
**kwargs
517520
):
518521

519522
"""
520523
cmap is a colors.Colormap instance
521524
norm is a colors.Normalize instance to map luminance to 0-1
522525
526+
kwargs are an optional list of Artist keyword args
523527
"""
524528
martist.Artist.__init__(self)
525529
cm.ScalarMappable.__init__(self, norm, cmap)
@@ -528,6 +532,7 @@ def __init__(self, fig,
528532
self.figure = fig
529533
self.ox = offsetx
530534
self.oy = offsety
535+
self.update(kwargs)
531536

532537
def contains(self, mouseevent):
533538
"""Test whether the mouse event occured within the image.

0 commit comments

Comments
 (0)