Skip to content

Commit 79e7b75

Browse files
anntzerstory645
authored andcommitted
Image interpolation selector in Qt figure options.
Test with `imshow(np.random.rand(10))` then click on the figure options button (Qt only).
1 parent 66f4ce7 commit 79e7b75

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ def prepare_data(d, init):
157157
('Label', label),
158158
('Colormap', [cmap.name] + cmaps),
159159
('Min. value', low),
160-
('Max. value', high)]
160+
('Max. value', high),
161+
('Interpolation',
162+
[image.get_interpolation()]
163+
+ [(name, name) for name in sorted(image.iterpnames)])]
161164
images.append([imagedata, label, ""])
162165
# Is there an image displayed?
163166
has_image = bool(images)
@@ -220,10 +223,11 @@ def apply_callback(data):
220223
# Set / Images
221224
for index, image_settings in enumerate(images):
222225
image = imagedict[imagelabels[index]]
223-
label, cmap, low, high = image_settings
226+
label, cmap, low, high, interpolation = image_settings
224227
image.set_label(label)
225228
image.set_cmap(cm.get_cmap(cmap))
226229
image.set_clim(*sorted([low, high]))
230+
image.set_interpolation(interpolation)
227231

228232
# re-generate legend, if checkbox is checked
229233
if generate_legend:

0 commit comments

Comments
 (0)