Installed Matplotlib, using an example of the official test run, found that when using the paint function, the running script always show no image, Google a bit, and later found that the matplotlibrc file is not configured well.
Refer to the official documentation for the following steps
1. Find the matplotlibrc file path
Enter the following statement in the idle
Import Matplotlibmatplotlib.matplotlib_fname ()
My display is /USR/LIB64/PYTHON2.7/SITE-PACKAGES/MATPLOTLIB/MPL-DATA/MATPLOTLIBRC .
2.vim Modify this file
Change the backend option to your system's graphical environment (my system is OpenSUSE13.2, the environment is QT)
# The default backend; one of the GTK gtkagg Gtkcairo gtk3agg Gtk3cairo # cocoaagg macosx qt4agg tkagg WX wxagg Agg Cairo GDK PS PDF SVG # Template # You can also deploy your own backend outside of Matplotlib by # referring to the module name (which must is in the PYTHONPATH) as # ' module://my_backend 'backend : Qt4agg
Reference Document: Customizing Matplotlib
Matplotlib Do not display graphics