From f5b9b119e88f619ee438c26063e4a7fb60e45c52 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Wed, 10 Aug 2016 19:33:30 -0700 Subject: [PATCH] Image interpolation selector in Qt figure options. Test with `imshow(np.random.rand(10))` then click on the figure options button (Qt only). --- lib/matplotlib/backends/qt_editor/figureoptions.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/backends/qt_editor/figureoptions.py b/lib/matplotlib/backends/qt_editor/figureoptions.py index 879b1cf6318..824db2c7bd7 100644 --- a/lib/matplotlib/backends/qt_editor/figureoptions.py +++ b/lib/matplotlib/backends/qt_editor/figureoptions.py @@ -157,7 +157,10 @@ def prepare_data(d, init): ('Label', label), ('Colormap', [cmap.name] + cmaps), ('Min. value', low), - ('Max. value', high)] + ('Max. value', high), + ('Interpolation', + [image.get_interpolation()] + + [(name, name) for name in sorted(image.iterpnames)])] images.append([imagedata, label, ""]) # Is there an image displayed? has_image = bool(images) @@ -220,10 +223,11 @@ def apply_callback(data): # Set / Images for index, image_settings in enumerate(images): image = imagedict[imagelabels[index]] - label, cmap, low, high = image_settings + label, cmap, low, high, interpolation = image_settings image.set_label(label) image.set_cmap(cm.get_cmap(cmap)) image.set_clim(*sorted([low, high])) + image.set_interpolation(interpolation) # re-generate legend, if checkbox is checked if generate_legend: