Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 88707e5

Browse files
author
domspad
committed
pylab to plt
1 parent ecce9a1 commit 88707e5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/pylab_examples/barchart_demo2.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"""
1111
import numpy as np
1212
import matplotlib.pyplot as plt
13-
import pylab
1413
from matplotlib.ticker import MaxNLocator
1514

1615
student = 'Johnny Doe'
@@ -33,7 +32,7 @@
3332
rects = ax1.barh(pos, rankings, align='center', height=0.5, color='m')
3433

3534
ax1.axis([0, 100, 0, 5])
36-
pylab.yticks(pos, testNames)
35+
plt.yticks(pos, testNames)
3736
ax1.set_title('Johnny Doe')
3837
plt.text(50, -0.5, 'Cohort Size: ' + str(cohortSize),
3938
horizontalalignment='center', size='small')
@@ -43,7 +42,7 @@
4342
ax2 = ax1.twinx()
4443
ax2.plot([100, 100], [0, 5], 'white', alpha=0.1)
4544
ax2.xaxis.set_major_locator(MaxNLocator(11))
46-
xticks = pylab.setp(ax2, xticklabels=['0', '10', '20', '30', '40', '50', '60',
45+
xticks = plt.setp(ax2, xticklabels=['0', '10', '20', '30', '40', '50', '60',
4746
'70', '80', '90', '100'])
4847
ax2.xaxis.grid(True, linestyle='--', which='major', color='grey',
4948
alpha=0.25)

0 commit comments

Comments
 (0)