Wednesday 24 July 2013

images in ipython notebook


subplot(221); title('19 degree flare. v22_y10-22-3')
imshow(imread('/home/me/Documents/acoustics/v22_y10-22-3-mesh.png'))



or, say:

def showImage(n=221, fn, title):
    """Convenience image display function"""
    subplot(n, frameon=False)
    title(title)
    ims = imread(fn)
    xticks([]); yticks([])

    imshow(ims)

showImage(221, 'myfile.png', 'This is my image!')

*Update*

The notebook now supports image inclusion via html:  this is better as the formatting is simple(r) and the functionality is built in.


No comments:

Post a Comment