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

Skip to content

Commit 4d6c905

Browse files
committed
fixed another example to use sample data
svn path=/trunk/matplotlib/; revision=7390
1 parent 8c49b9a commit 4d6c905

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

examples/pylab_examples/mri_demo.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/usr/bin/env python
22
from pylab import *
3-
3+
import matplotlib.cbook as cbook
44
# data are 256x256 16 bit integers
5-
dfile = '../data/s1045.ima'
6-
im = fromstring(file(dfile, 'rb').read(), uint16).astype(float)
5+
dfile = cbook.get_sample_data('s1045.ima', asfileobj=False)
6+
print 'loading image', dfile
7+
im = np.fromstring(file(dfile, 'rb').read(), np.uint16).astype(float)
78
im.shape = 256, 256
89

910
#imshow(im, ColormapJet(256))

0 commit comments

Comments
 (0)