Skip to content

[Bug]: Mismatch in documented default behaviour of pcolormesh 'snap' #30709

Closed

Description

@mo-nstebbin

Bug summary

The documentation for pcolormesh states the default behaviour for snap is False. Since a supposed temporary addition of pcolormesh.snap to the default rcParams under b38c7de for 3.4.3, this is no longer the case and instead you get True behaviour by default. The documentation and default behaviour should probably match.

This switch in default behaviour is most obvious when plotting a pcolormesh plot with an alpha value less than 1.

Code for reproduction

import matplotlib as mpl
import matplotlib.pyplot as plt

test_array = [
             [1, 3, 5, 6, 2, 1],
             [0, 2, 4, 6, 3, 1],
             [1, 2, 4, 4, 2, 1],
             [0, 0, 2, 3, 2, 1],
             [0, 0, 1, 2, 2, 0],
             [0, 0, 1, 1, 0, 0],
             ]

p1 = plt.pcolormesh(test_array, alpha=0.5)

#print(mpl.rcParams['pcolormesh.snap'])
print("default", p1.get_snap())

plt.savefig(f"test_snapD_old.png")
plt.close()

Actual outcome

Under 3.10.1

True
default True
Image

Expected outcome

Under 3.3.4

default None
Image

Additional information

Either the temporary rcParam should be removed from the default template or the documentation should be changed to match the present default behaviour.

Operating system

No response

Matplotlib Version

3.10.1

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

None

Activity

  1. timhoffm commented on Oct 31, 2025

    @timhoffm
    Member

    This is an omission in updating documentation for pcolormesh.

    The behavior was intentionally changed see

    Only the rcParam is temporary. It will eventually be removed, because that behavior should not be configurable via rcParams. But the snap=True behavior will remain.

  2. sanrishi commented on Dec 29, 2025

    @sanrishi
    Contributor

    I would like to work on this documentation

  3. added this to the v3.11.0 milestone on Jan 2, 2026
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