[ENH]: Consider bilinear interpolation for pcolormesh

Ouverte
#32,518 7 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@Adithya6721 y travaille déjà.

Depuis le 2/11/2026.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
38/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
matplotlib, python

Piste de recherche

Start by reading the pcolormesh() shading implementation and its tests, then trace how Gouraud shading interpolates values across each quadrilateral. The issue proposes adding bilinear interpolation but does not specify the API or expected behavior beyond that; clarify those design choices before implementation. Done means a bilinear shading option with tests covering the quadrilateral interpolation behavior.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

New feature status: needs comment/discussion
Problem

Currently the only "interpolating" shading of pcolormesh() is "gouraud". This is somewhat special: It splits the quadrilateral into two triangles and uses Gouraud shading for each. If the z values of the corners are not in a plane, this produces characteristic patterns and the result will depend on how the two triangles are chosen; e.g.

import matplotlib.pyplot as plt
import numpy as np

x = np.arange(6)
y = np.arange(6)
X, Y = np.meshgrid(x, y)
Z = X + 2*Y
Z[2,3] = 15
plt.pcolormesh(X, Y, Z, shading="gouraud", edgecolors='red', linewidth=2)
plt.show()
Image
Proposed solution

It would be nice to additionally have a simple bilinear interpolation.

Langage dominant
Python
Étoiles
23.5k
Forks
8.6k
Merge moyen
1 j 19 h
PR mergées (30 j)
64

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de matplotlib/matplotlib

Toutes les issues de matplotlib/matplotlib

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.