8000
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 88707e5 commit 9e6d737Copy full SHA for 9e6d737
examples/pylab_examples/barcode_demo.py
@@ -1,14 +1,13 @@
1
-from matplotlib.pyplot import figure, show, cm
2
-from numpy import where
3
-from numpy.random import rand
+import matplotlib.pyplot as plt
+import numpy as np
4
5
# the bar
6
-x = where(rand(500) > 0.7, 1.0, 0.0)
+x = np.where(np.random.rand(500) > 0.7, 1.0, 0.0)
7
8
axprops = dict(xticks=[], yticks=[])
9
-barprops = dict(aspect='auto', cmap=cm.binary, interpolation='nearest')
+barprops = dict(aspect='auto', cmap=plt.cm.binary, interpolation='nearest')
10
11
-fig = figure()
+fig = plt.figure()
12
13
# a vertical barcode -- this is broken at present
14
x.shape = len(x), 1
@@ -22,4 +21,4 @@
22
21
ax.imshow(x, **barprops)
23
24
25
-show()
+plt.show()
0 commit comments