From 81470c0e6a3183f3865244b6acf39b3d9c071ee6 Mon Sep 17 00:00:00 2001 From: "Alex J. Champandard" Date: Wed, 24 Jun 2015 23:03:48 +0200 Subject: [PATCH] Changes to pylab code, seems to have changed API? --- examples/plot_digits.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/plot_digits.py b/examples/plot_digits.py index 8021d2e..851c801 100644 --- a/examples/plot_digits.py +++ b/examples/plot_digits.py @@ -36,15 +36,15 @@ # Show some training images and some test images too. -import pylab +import matplotlib.pyplot as pylab -for index, (image, label) in enumerate(zip(digits.images, digits.target)[:6]): +for index, (image, label) in enumerate(zip(digits.images[:6], digits.target[:6])): pylab.subplot(2, 6, index + 1) pylab.axis('off') pylab.imshow(image, cmap=pylab.cm.gray_r, interpolation='nearest') pylab.title('Training: %i' % label) -for index, (image, prediction) in enumerate(zip(X_test, y_pred)[:6]): +for index, (image, prediction) in enumerate(zip(X_test[:6], y_pred[:6])): pylab.subplot(2, 6, index + 7) pylab.axis('off') pylab.imshow(image.reshape((8,8)), cmap=pylab.cm.gray_r, interpolation='nearest')