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.
2 parents 54bdd3e + 14683b8 commit d22f626Copy full SHA for d22f626
examples/pylab_examples/mri_demo.py
@@ -1,15 +1,13 @@
1
-#!/usr/bin/env python
2
-
3
from __future__ import print_function
4
-from pylab import *
+import matplotlib.pyplot as plt
5
import matplotlib.cbook as cbook
+import numpy as np
6
# data are 256x256 16 bit integers
7
dfile = cbook.get_sample_data('s1045.ima.gz')
8
im = np.fromstring(dfile.read(), np.uint16).astype(float)
9
im.shape = 256, 256
10
11
-#imshow(im, ColormapJet(256))
12
-imshow(im, cmap=cm.gray)
13
-axis('off')
+plt.imshow(im, cmap=plt.cm.gray)
+plt.axis('off')
14
15
-show()
+plt.show()
0 commit comments