Skip to content

[Bug]: interpolation_stage="rgba" does not respect array-alpha #28382

Closed

Description

@anntzer

Bug summary

Passing interpolation_stage="rgba" to imshow() results in array-valued alphas being ignored.

Code for reproduction

from pylab import *

im = arange(9).reshape(3, 3)
alpha = linspace(0, 1, 9).reshape(3, 3)

subplot(121).imshow(im, alpha=alpha)  # interpolation_stage="alpha"
subplot(122).imshow(im, alpha=alpha, interpolation_stage="rgba")
show()

Actual outcome

Figure_1

Expected outcome

Same image on left and right (interpolation_stage should not matter at all here.

Additional information

No response

Operating system

macos

Matplotlib Version

3.10.0.dev260+g7275ad95ff

Matplotlib Backend

qtagg

Python version

3.12

Jupyter version

no

Installation

git checkout

Activity

  1. chaoyihu commented on Jun 22, 2024

    @chaoyihu
    Contributor

    Thanks for raising this issue. The problem is with _ImageBase::_make_image where alpha is written as a scalar when interpolation_stage='rgba'.

    I have submitted #28437 which will hopefully resolve this issue.

  2. added this to the v3.10.1 milestone on Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions