Sounds like an interesting project. The first item I'd
> have on a list of desired features is, surprise, the
> ability to load multiple aligned images and blink between
> them.
With the new keypress event handling in matplotlib-0.70, and the
cleanup to make sure the visible property is respected, this is pretty
easy. The example below is more complicated than you need for the
usual case, since it handles images of different pixel dimensions that
occupy the same physical dimensions, but it gives you the idea (btw,
this is now examples/toggle_images.py, which contains a bit more
information in the header)
What's the second item on the list
JDH
from pylab import *
# two images x1 is initially visible, x2 is not
x1 = rand(100, 100)
x2 = rand(150, 175)
# arbitrary extent - both images must have same extent if you want
# them to be resampled into the same axes space
extent = (0,1,0,1)
im1 = imshow(x1, extent=extent)
im2 = imshow(x2, extent=extent, hold=True)
im2.set_visible(False)
def toggle_images(event):
'toggle the visible state of the two images'
if event.key != 't': return
b1 = im1.get_visible()
b2 = im2.get_visible()
im1.set_visible(not b1)
im2.set_visible(not b2)
draw()
connect('key_press_event', toggle_images)
#savefig('toggle_images')
show()