Why matplotlib does not plot?

It could be a problem with the backend. What is the output of python -c 'import matplotlib; import matplotlib.pyplot; print(matplotlib.backends.backend)'?

If it is the ‘agg’ backend, what you see is the expected behaviour as it is a non-interactive backend that does not show anything to the screen, but work with plt.savefig(…). You should switch to, e.g., TkAgg or Qt4Agg to be able to use show. You can do it in the matplotlib.rc file.

@shashank: I run matplotlib both on 12.04 and 12.10 without problems. In both cases I use the Qt4Agg backend. If you don’t have the matplotlibrc set, the default backend is used. I’m sure that for Precise matplotlib repo was built with TkAgg. If the Quantal version has been built with e.g. Agg, then that would explain the difference

Leave a Comment