Skip to content

Commit d501818

Browse files
committed
mep12 on log_bar.py
1 parent 7539b61 commit d501818

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

examples/pylab_examples/log_bar.py

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
#!/usr/bin/env python
2-
3-
from matplotlib import pylab
1+
import matplotlib.pyplot as plt
2+
import numpy as np
43

54
data = ((3, 1000), (10, 3), (100, 30), (500, 800), (50, 1))
65

7-
pylab.xlabel("FOO")
8-
pylab.ylabel("FOO")
9-
pylab.title("Testing")
10-
pylab.gca().set_yscale('log')
6+
plt.xlabel("FOO")
7+
plt.ylabel("FOO")
8+
plt.title("Testing")
9+
plt.gca().set_yscale('log')
1110

1211
dim = len(data[0])
1312
w = 0.75
1413
dimw = w / dim
1514

16-
x = pylab.arange(len(data))
15+
x = np.arange(len(data))
1716
for i in range(len(data[0])):
1817
y = [d[i] for d in data]
19-
b = pylab.bar(x + i * dimw, y, dimw, bottom=0.001)
20-
pylab.gca().set_xticks(x + w / 2)
21-
pylab.gca().set_ylim((0.001, 1000))
18+
b = plt.bar(x + i * dimw, y, dimw, bottom=0.001)
19+
plt.gca().set_xticks(x + w / 2)
20+
plt.gca().set_ylim((0.001, 1000))
2221

23-
pylab.show()
22+
plt.show()

0 commit comments

Comments
 (0)