close

[Solved] UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to plot graph using matplotlib.pyplot but I am facing following error UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure Error Occurs ?

I am trying to plot graph using matplotlib.pyplot but I am facing following error.

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

How To Solve UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure Error ?

  1. How To Solve UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure Error ?

    To Solve UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure Error Here Error is mentioning that You must have installed GUI backend So that Just Install the GUI backend tk Using this command: sudo apt-get install python3-tk Second solution is You just need to install any of the matplolib GUI backends will solve your error. For example you can pyqt5 will fix the issue. Just use this command: pip install pyqt5.

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

    To Solve UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure Error Here Error is mentioning that You must have installed GUI backend So that Just Install the GUI backend tk Using this command: sudo apt-get install python3-tk Second solution is You just need to install any of the matplolib GUI backends will solve your error. For example you can pyqt5 will fix the issue. Just use this command: pip install pyqt5.

Solution 1: install the GUI backend tk

Error is mentioning that You must have installed GUI backend So that Just Install the GUI backend tk Using this command.

sudo apt-get install python3-tk

Solution 2: install any of the matplolib GUI backends

You just need to install any of the matplolib GUI backends will solve your error. For example you can pyqt5 will fix the issue. Just use this command.

pip install pyqt5

Solution 3: Simply install PyQt5

Simple install

pip3 install PyQt5==5.9.2

It works for me.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Leave a Comment