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.
changed the title [-][ENH]: Condsider bilinear interpolation for pcolormesh[/-][+][ENH]: Consider bilinear interpolation for pcolormesh[/+]on Oct 22, 2026
This would be simple to implement when X/Y are not provided, but proper bilinear interpolation is mathematically complicated for arbitrary X/Y input (e.g., an irregular grid where the quadrilaterals are not parallelograms).
It would be ok to only do this for rectangular / parallelogram quadrilaterals and error out otherwise.
There may also be reasonable invertible transformations that transform an arbitrary quadrilateral to a “closest” regular quadrilateral on which we could apply the bilinear interpolation and transform the result back. But that would need a closer look.
Activity
ayshih commented on Oct 22, 2026
This would be simple to implement when X/Y are not provided, but proper bilinear interpolation is mathematically complicated for arbitrary X/Y input (e.g., an irregular grid where the quadrilaterals are not parallelograms).
timhoffm commented on Oct 23, 2026
It would be ok to only do this for rectangular / parallelogram quadrilaterals and error out otherwise.
There may also be reasonable invertible transformations that transform an arbitrary quadrilateral to a “closest” regular quadrilateral on which we could apply the bilinear interpolation and transform the result back. But that would need a closer look.