Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tripcolor shading="gouraud" streaks/glitch on macOS arm64; shading="flat" is fine #32269

Description

@matthew-a12

Bug summary

On macOS arm64, tripcolor(..., shading="gouraud") draws long coloured streaks and glitches. The same mesh with shading="flat" is fine. Standalone matplotlib + numpy, Agg backend. Other machines render both panels identically.

Code for reproduction

import matplotlib.pyplot as plt
import numpy as np

m = np.load("gouraud_mesh.npz")  # attach this file
pts, cells, vals = m["pts"], m["cells"], m["vals"]
fig, ax = plt.subplots(1, 2, figsize=(12, 4), constrained_layout=True)
for a, sh in zip(ax, ("flat", "gouraud")):
    im = a.tripcolor(pts[:, 0], pts[:, 1], cells, vals, shading=sh, cmap="jet")
    a.set_aspect("equal")
    a.set_title(sh)
    fig.colorbar(im, ax=a)
fig.savefig("gouraud_test_result.png", dpi=200)

Actual outcome

Image

Left (flat): smooth field. Right (gouraud): radial streaks (PNG attached). Same with savefig/Agg.

Expected outcome

Gouraud should look like a smooth version of the flat panel, matching other machines.

Additional information

matplotlib 3.10.3 backend: Agg
numpy 2.0.2
python 3.12.7
OS macOS-26.6.2-arm64-arm-64bit

Also on matplotlib 3.11.1

Only the Gouraud path fails. Force-reinstall and a fresh env did not help. Workaround: shading="flat". Distinct from #28769 (small colour offset, not streaking).

Operating system

macOS 26.6.2 arm64

Matplotlib Version

3.10.3 (also 3.11.1)

Matplotlib Backend

Agg (also macosx)

Python version

3.12.7

Jupyter version

No response

Installation

pip

Activity

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions