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

+1 vote

Hi everyone,

I am trying to plot using matplotlib. But I am getting the below error.

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

How can I solve this?

Thank You

Feb 27, 2020 in Machine Learning by akhtar
• 38,260 points
63,005 views

1 answer to this question.

0 votes
Best answer

Hi@akhtar,

You need to install a GUI toolkit, so that Matplotlib can display graphics (outside of Jupyter, where the browser handles display). For example, if you install the pyqt package then PyPlot should automatically use the qt5agg backend.

$ pip3 install PyQt5==5.9.2

Hope this will work.

Read the Artificial Intelligence tutorial to learn more about Artificial Intelligence and Machine Learning. Also, enrol in Machine Learning Course to become proficient.


Thank You 

answered Mar 5, 2020 by MD
• 95,460 points

edited Aug 11, 2021 by Soumya
MD, thanks a lot! I spent several days to solve the issue, but your suggestion helped me out!
me salvaste la vida capo

Related Questions In Machine Learning

0 votes
1 answer
0 votes
1 answer

What is the difference between a Confusion Matrix and Contingency Table?

Confusion Matrix is a classification matrix used ...READ MORE

answered Mar 2, 2022 in Machine Learning by Dev
• 6,000 points
1,806 views
0 votes
1 answer

Keras image binary classification, which class is assigned probability 0 and 1 ? Using Functional API

Not exactly.  If your sigmoid output was ...READ MORE

answered Mar 7, 2022 in Machine Learning by Dev
• 6,000 points
1,699 views
0 votes
1 answer

Can I draw a regression line and show parameters using scatterplot with a pandas dataframe?

There isn't a parameter for DataFrame.plot(). Seaborn, ...READ MORE

answered Mar 7, 2022 in Machine Learning by Dev
• 6,000 points
2,877 views
+1 vote
1 answer

How to create plots using python matplotlib in IPython notebook?

I think you should try: I used %matplotlib inline in ...READ MORE

answered Aug 8, 2018 in Python by Priyaj
• 58,100 points
1,522 views
+1 vote
1 answer

How to handle Real-Time Matplotlib Plotting

To draw a continuous set of random ...READ MORE

answered Sep 26, 2018 in Python by Priyaj
• 58,100 points
16,341 views
0 votes
1 answer

How to increase plt.title font size?

Try the following : import matplotlib.pyplot as plt plt.figtext(.5,.9,'Temperature', ...READ MORE

answered Feb 11, 2019 in Python by SDeb
• 13,300 points
1,133 views
0 votes
1 answer

What is the best machine learning website?

Hi@akhtar You can find lots of website which ...READ MORE

answered May 20, 2020 in Machine Learning by MD
• 95,460 points
743 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP