### Bug summary `pyplot.contour` raises `IndexError` when `Z` is specified as `Z=a`. ### Code for reproduction ```python import matplotlib.pyplot as plt plt.contour(Z=np.random.rand(30, 30)) ``` ### Actual outcome <img width="1675" alt="Screen Shot 2022-12-15 at 8 23 39 PM" src="https://user-images.githubusercontent.com/5158900/208021934-85af4c76-16ed-4fcc-8eb1-93c564bf5086.png"> ### Expected outcome <img width="713" alt="Screen Shot 2022-12-15 at 8 24 46 PM" src="https://user-images.githubusercontent.com/5158900/208021798-836753c1-f34f-4176-9d50-fd6ad6bdeb32.png"> ### Additional information _No response_ ### Operating system OS/X ### Matplotlib Version 3.6.2 ### Matplotlib Backend module://matplotlib_inline.backend_inline ### Python version Python 3.8.15 ### Jupyter version 6.5.2 ### Installation pip