8

I'm using Ubuntu 20.04 LTS. I've recently installed Matplotlib for Python 3.9 and when I try to plot a graph it gives me the error:

Matplotlib is currently using agg, which is non-GUI backend, so cannot show the figure.

Do I have to install something else for it to work?

Unnamed
  • 353

1 Answers1

11

Yes, you have to. The accepted answer to this similar Stack Overflow question suggests that the problem is that tkinter is not installed. You can install it using:

sudo apt install python3-tk