Skip to content

Commit 518d70f

Browse files
TsufaelQuLogic
authored andcommitted
ENH: add interpolation_stage in qt figureoptions
add interpolation_stage selector for images in qt figureoptions
1 parent 43fcc54 commit 518d70f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/matplotlib/backends/qt_editor/figureoptions.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ def prepare_data(d, init):
164164
mappabledata.append((
165165
'Interpolation',
166166
[mappable.get_interpolation(), *interpolations]))
167+
168+
interpolation_stages = ['data', 'rgba']
169+
mappabledata.append((
170+
'Interpolation stage',
171+
[mappable.get_interpolation_stage(), *interpolation_stages]))
172+
167173
mappables.append([mappabledata, label, ""])
168174
# Is there a scalarmappable displayed?
169175
has_sm = bool(mappables)
@@ -227,9 +233,11 @@ def apply_callback(data):
227233
# Set ScalarMappables.
228234
for index, mappable_settings in enumerate(mappables):
229235
mappable = labeled_mappables[index][1]
230-
if len(mappable_settings) == 5:
231-
label, cmap, low, high, interpolation = mappable_settings
236+
if len(mappable_settings) == 6:
237+
label, cmap, low, high, interpolation, interpolation_stage = \
238+
mappable_settings
232239
mappable.set_interpolation(interpolation)
240+
mappable.set_interpolation_stage(interpolation_stage)
233241
elif len(mappable_settings) == 4:
234242
label, cmap, low, high = mappable_settings
235243
mappable.set_label(label)

0 commit comments

Comments
 (0)