##// END OF EJS Templates
Remove unmaintained lists of contributors...
Remove unmaintained lists of contributors These haven't been updated for years, and we now do a listing on each release based on git logs. Closes gh-8613

File last commit:

r20541:1e566dcc
r21561:b831b296
Show More
Image Browser.ipynb
119 lines | 2.2 KiB | text/plain | TextLexer

Image Browser

This example shows how to browse through a set of images with a slider.

In [ ]:
%matplotlib inline
import matplotlib.pyplot as plt
In [ ]:
from IPython.html.widgets import interact
In [ ]:
from sklearn import datasets

We will use the digits dataset from scikit-learn.

In [ ]:
digits = datasets.load_digits()
In [ ]:
def browse_images(digits):
    n = len(digits.images)
    def view_image(i):
        plt.imshow(digits.images[i], cmap=plt.cm.gray_r, interpolation='nearest')
        plt.title('Training: %s' % digits.target[i])
        plt.show()
    interact(view_image, i=(0,n-1))
In [ ]:
browse_images(digits)