Skip to content

pcolor deprecation warning with default settings #18546

Closed
@johnomotani

Description

@johnomotani

Bug report

Bug summary

pcolor() produces a deprecation warning with default settings.

The default of rcParams['pcolor.shading'] seems to be 'flat', which is deprecated (at least sometimes). Maybe the default should be changed to 'auto' or 'nearest'?

Code for reproduction

from matplotlib import pyplot as plt
import numpy as np

x = np.arange(2.)
y = np.arange(2.)
z = np.ones([2,2])

plt.pcolor(x,y,z)

Actual outcome

MatplotlibDeprecationWarning: shading='flat' when X and Y have the same dimensions as C is deprecated since 3.3.  Either specify the corners of the quadrilaterals with X and Y, or pass shading='auto', 'nearest' or 'gouraud', or set rcParams['pcolor.shading'].  This will become an error two minor releases later.
  plt.pcolor(x,y,z)

Expected outcome

No warning

Matplotlib version

  • Operating system: Linux Mint 19
  • Matplotlib version: 3.3.2
  • Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
  • Python version: 3.7.6
  • Jupyter version (if applicable): N/A
  • Other libraries: None

Installed with conda from conda-forge

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions