matplotlib plot window won’t appear

I’m not convinced this is a pandas issue at all.

Does

import matplotlib.pyplot as plt
plt.plot(range(10))
plt.show()

bring up a plot?

If not:

How did you install matplotlib? Was it from source or did you install it from a package manager/pre-built binary?

I suspect that if you run:

import matplotlib            
print matplotlib.rcParams['backend']

The result will be a non-GUI backend (almost certainly “Agg”). This suggests you don’t have a suitable GUI toolkit available (I personally use Tkinter which means my backend is reported as “TkAgg”).

The solution to this depends on your operating system, but if you can install a GUI library (one of Tkinter, GTK, QT4, PySide, Wx) then pyplot.show() should hopefully pop up a window for you.

HTH,

Leave a Comment