Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9e6d737

Browse filesBrowse files
author
domspad
committed
explicit imports from plt
1 parent 88707e5 commit 9e6d737
Copy full SHA for 9e6d737

File tree

Expand file treeCollapse file tree

1 file changed

+6
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-7
lines changed
+6-7Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
from matplotlib.pyplot import figure, show, cm
2-
from numpy import where
3-
from numpy.random import rand
1+
import matplotlib.pyplot as plt
2+
import numpy as np
43

54
# the bar
6-
x = where(rand(500) > 0.7, 1.0, 0.0)
5+
x = np.where(np.random.rand(500) > 0.7, 1.0, 0.0)
76

87
axprops = dict(xticks=[], yticks=[])
9-
barprops = dict(aspect='auto', cmap=cm.binary, interpolation='nearest')
8+
barprops = dict(aspect='auto', cmap=plt.cm.binary, interpolation='nearest')
109

11-
fig = figure()
10+
fig = plt.figure()
1211

1312
# a vertical barcode -- this is broken at present
1413
x.shape = len(x), 1
@@ -22,4 +21,4 @@
2221
ax.imshow(x, **barprops)
2322

2423

25-
show()
24+
plt.show()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.