##// END OF EJS Templates
Backport PR #5488: Added missing require and jquery from cdn....
Backport PR #5488: Added missing require and jquery from cdn. For some reason (I suppose some changes at the css level) the font size inside the input cells was fixed at 14 px... making the fonts really small in the reveal slideshows. This is really annoying... As a plus, I have also added the missing calls for require and jquery (as the full html template does). I think these fixes belong to 2.0, but I also know we are on the edge... so I hope to get it inside :wink: Cheers.

File last commit:

r16120:24b93a1d
r16230:ba262623
Show More
Image Browser.ipynb
123 lines | 16.6 KiB | text/plain | TextLexer

Image Browser

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

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

We will use the digits dataset from scikit-learn.

In [12]:
digits = datasets.load_digits()
In [14]:
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 [15]:
browse_images(digits)
No description has been provided for this image