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 db3d206 commit 96ff817Copy full SHA for 96ff817
1 file changed
examples/pylab_examples/mri_demo.py
@@ -2,15 +2,18 @@
2
3
import matplotlib.pyplot as plt
4
import matplotlib.cbook as cbook
5
+import matplotlib.cm as cm
6
import numpy as np
7
8
+fig, ax = plt.subplots(num="MRI_demo")
9
+
10
# Data are 256x256 16 bit integers
11
dfile = cbook.get_sample_data('s1045.ima.gz')
12
im = np.fromstring(dfile.read(), np.uint16).astype(float)
13
im.shape = (256, 256)
14
dfile.close()
15
-plt.imshow(im, cmap=plt.cm.gray)
-plt.axis('off')
16
+ax.imshow(im, cmap=cm.gray)
17
+ax.axis('off')
18
19
plt.show()
0 commit comments