Bug summary
pcolormesh/pcolor doesn't display the image of an array of size M*1 or 1*M when providing the parameters X and Y explicitly. If only the paramter C is provided, the two functions work well.
Code for reproduction
import matplotlib.pyplot as plt
import numpy as np
x, y = np.meshgrid([1,2], [1])
z = x + y
plt.pcolor(x, y, z) # or plt.pcolormesh(x, y, z), both of which give an empty figure.
plt.pcolor(z) # or plt.pcolormesh(z), both of which work well.
Actual outcome
plt.pcolor(x, y, z) gives an empty figure, while plt.pcolor(z) works as expected.
Expected outcome
Both of plt.pcolor(x, y, z) and plt.pcolor(z) should show the chart.
Additional information
No response
Operating system
Windows
Matplotlib Version
3.7.1
Matplotlib Backend
module://matplotlib_inline.backend_inline OR QtAgg
Python version
3.10.10
Jupyter version
3.6.3
Installation
conda
Bug summary
pcolormesh/pcolordoesn't display the image of an array of size M*1 or 1*M when providing the parametersXandYexplicitly. If only the paramterCis provided, the two functions work well.Code for reproduction
Actual outcome
plt.pcolor(x, y, z)gives an empty figure, whileplt.pcolor(z)works as expected.Expected outcome
Both of
plt.pcolor(x, y, z)andplt.pcolor(z)should show the chart.Additional information
No response
Operating system
Windows
Matplotlib Version
3.7.1
Matplotlib Backend
module://matplotlib_inline.backend_inline OR QtAgg
Python version
3.10.10
Jupyter version
3.6.3
Installation
conda