I am trying to display data as an image using matplotlib, but I received this error: AttributeError module 'matplotlib' has no attribute 'imshow'
Here is an example code:
import numpy as np
import matplotlib as plt
im = np.arange(10)
im = im[np.newaxis, :]
im = np.repeat(im, 10, axis=0)
plt.imshow(im, cmap='gray')
using : python : 3.7.9 matplotlib: 3.3.4
The import should be:
import matplotlib.pyplot as plt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With