Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dfc9cca commit db3d206Copy full SHA for db3d206
1 file changed
examples/pylab_examples/mri_demo.py
@@ -1,11 +1,14 @@
1
-from __future__ import print_function
+"""Displays an MRI image."""
2
+
3
import matplotlib.pyplot as plt
4
import matplotlib.cbook as cbook
5
import numpy as np
-# data are 256x256 16 bit integers
6
7
+# Data are 256x256 16 bit integers
8
dfile = cbook.get_sample_data('s1045.ima.gz')
9
im = np.fromstring(dfile.read(), np.uint16).astype(float)
-im.shape = 256, 256
10
+im.shape = (256, 256)
11
+dfile.close()
12
13
plt.imshow(im, cmap=plt.cm.gray)
14
plt.axis('off')
0 commit comments