diff --git a/lib/matplotlib/backends/qt_editor/figureoptions.py b/lib/matplotlib/backends/qt_editor/figureoptions.py index c744ccc3ca59..c36bbeb62641 100644 --- a/lib/matplotlib/backends/qt_editor/figureoptions.py +++ b/lib/matplotlib/backends/qt_editor/figureoptions.py @@ -164,6 +164,12 @@ def prepare_data(d, init): mappabledata.append(( 'Interpolation', [mappable.get_interpolation(), *interpolations])) + + interpolation_stages = ['data', 'rgba'] + mappabledata.append(( + 'Interpolation stage', + [mappable.get_interpolation_stage(), *interpolation_stages])) + mappables.append([mappabledata, label, ""]) # Is there a scalarmappable displayed? has_sm = bool(mappables) @@ -227,9 +233,11 @@ def apply_callback(data): # Set ScalarMappables. for index, mappable_settings in enumerate(mappables): mappable = labeled_mappables[index][1] - if len(mappable_settings) == 5: - label, cmap, low, high, interpolation = mappable_settings + if len(mappable_settings) == 6: + label, cmap, low, high, interpolation, interpolation_stage = \ + mappable_settings mappable.set_interpolation(interpolation) + mappable.set_interpolation_stage(interpolation_stage) elif len(mappable_settings) == 4: label, cmap, low, high = mappable_settings mappable.set_label(label) diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 73738fe3bdbe..3741c2cdecb3 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -773,6 +773,14 @@ def set_interpolation(self, s): self._interpolation = s self.stale = True + def get_interpolation_stage(self): + """ + Return when interpolation happens during the transform to RGBA. + + One of 'data', 'rgba'. + """ + return self._interpolation_stage + def set_interpolation_stage(self, s): """ Set when interpolation happens during the transform to RGBA. diff --git a/lib/matplotlib/image.pyi b/lib/matplotlib/image.pyi index 20fdc3ff946a..4b684f693845 100644 --- a/lib/matplotlib/image.pyi +++ b/lib/matplotlib/image.pyi @@ -89,6 +89,7 @@ class _ImageBase(martist.Artist, cm.ScalarMappable): def get_shape(self) -> tuple[int, int, int]: ... def get_interpolation(self) -> str: ... def set_interpolation(self, s: str | None) -> None: ... + def get_interpolation_stage(self) -> Literal["data", "rgba"]: ... def set_interpolation_stage(self, s: Literal["data", "rgba"]) -> None: ... def can_composite(self) -> bool: ... def set_resample(self, v: bool | None) -> None: ... pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy