I am trying display an image with matplotlib.pyplot in pycharm's (2021.3 community edition) on Ubuntu 20.04.3 LTS
import matplotlib.pyplot as plt
...
plt.imshow(img)
plt.show()
but got the error:
UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
plt.show()
I also tried plt.imshow(x) in debugging mode and got <matplotlib.image.AxesImage at 0x7f1d6436f490> without displaying the image. Both of them used to work before. I don't know where the problem is coming from.