How do you solve the problem when plotting the image in Pycharm using Matplotlib?

Asked

Viewed 44 times

0

I am having trouble displaying the image/graph using pycharm community, when I run the code I get the following error message:

UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure. 
plt.show()

The code I used as a test to see if the chart appears in the pycharm community:

import matplotlib.pyplot as plt

x = [5, 6, 7, 4]
y = [9, 3, 2, 1]

plt.plot(x,y)
plt.show()

But the same code works normal if I run by terminal, Spyder or Pycharm professional (I downloaded only to test, I have no license). Currently I am using Linux Pop! _OS, but before I used in Windows 8 and it worked normal. I wonder if there’s any way around that. I use python3.8.5 native to the system. I have tried to install 3.9 but also without success. No longer know what else to do, I looked for tips in other posts but none served me. If you can help me I will be grateful.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.