return fig
+def get_possible_interpolations():
+ try: # Matplotlib v1.0.1
+ return sorted(matplotlib.image.AxesImage._interpd.keys())
+ except AttributeError:
+ try: # Matplotlib v0.91.2
+ return sorted(matplotlib.image.AxesImage(None)._interpd.keys())
+ except AttributeError:
+ # give up ;)
+ pass
+ return ['nearest']
+
def test():
import doctest
results = doctest.testmod()
help='Title (%default)')
p.add_option('--test', dest='test', action='store_true',
help='Run internal tests and exit.')
- interpolations = sorted(matplotlib.image.AxesImage._interpd.keys())
+ interpolations = get_possible_interpolations()
p.add_option('--interpolation', dest='interpolation', default='nearest',
help=('Interpolation scheme (for false color images) from %s '
'(%%default)') % ', '.join(interpolations))