Skip to content

[Bug]: diagonal lines in pcolormesh with Gouraud shading and transparency #27016

@limwz01

Description

@limwz01

Bug summary

Diagonal and box lines are produced by pcolormesh using a cmap with transparency.

Code for reproduction

import matplotlib.colors as m_colors
import matplotlib.pyplot as plt
import numpy as np
plt.pcolormesh(np.array([[0, 1, 2], [0, 1, 2]]),
               np.array([[0, 0, 0], [1, 1, 1]]),
               np.array([[0, 1, 2], [0, 1, 2]]),
               cmap=m_colors.LinearSegmentedColormap.from_list(
                   "", [(0, 0, 0, 0), (0, 0, 0, 1)]),
               shading="gouraud")
plt.plot()

Actual outcome

Figure_1

Expected outcome

No diagonal or box lines should appear.

Additional information

No response

Operating system

No response

Matplotlib Version

3.6.2

Matplotlib Backend

QtAgg

Python version

No response

Jupyter version

No response

Installation

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions