Skip to content
This repository was archived by the owner on Jul 10, 2021. It is now read-only.

Commit 81470c0

Browse files
committed
Changes to pylab code, seems to have changed API?
1 parent 1de7d2b commit 81470c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/plot_digits.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@
3636

3737

3838
# Show some training images and some test images too.
39-
import pylab
39+
import matplotlib.pyplot as pylab
4040

41-
for index, (image, label) in enumerate(zip(digits.images, digits.target)[:6]):
41+
for index, (image, label) in enumerate(zip(digits.images[:6], digits.target[:6])):
4242
pylab.subplot(2, 6, index + 1)
4343
pylab.axis('off')
4444
pylab.imshow(image, cmap=pylab.cm.gray_r, interpolation='nearest')
4545
pylab.title('Training: %i' % label)
4646

47-
for index, (image, prediction) in enumerate(zip(X_test, y_pred)[:6]):
47+
for index, (image, prediction) in enumerate(zip(X_test[:6], y_pred[:6])):
4848
pylab.subplot(2, 6, index + 7)
4949
pylab.axis('off')
5050
pylab.imshow(image.reshape((8,8)), cmap=pylab.cm.gray_r, interpolation='nearest')

0 commit comments

Comments
 (0)