import matplotlib matplotlib.pyplot.get_backend() # or matplotlib.rcParams['backend']
import matplotlib
matplotlib.use('GTKAgg')
import matplotlib matplotlib.rcsetup.interactive_bk matplotlib.rcsetup.non_interactive_bk matplotlib.rcsetup.all_backends
/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk.py:253: Warning: Source ID 70 was not found when attempting to remove it gobject.source_remove(self._idle_event_id)
The solution is to modify /usr/lib/python2.7/dist-packages/matplotlib/backend_bases.py by adding “return True” to the end of function “def idle_event(self, guiEvent=None):”. Ref
csfont = {'fontname':'Comic Sans MS'}
hfont = {'fontname':'Helvetica'}
plt.title('title',**csfont)
plt.xlabel('xlabel', **hfont)
plt.show()