你如何确定matplotlib正在使用哪个后端?
无论是交互式的,例如从一个Ipython会话中,或者从一个脚本中,如何确定matplotlib正在使用哪个后端?
使用get_backend()函数获取表示正在使用哪个后端的string: 
 >>> import matplotlib >>> matplotlib.get_backend() 'TkAgg' 
 另一种确定当前后端的方法是读取rcParams字典: 
 >>> import matplotlib >>> print (matplotlib.rcParams['backend']) MacOSX >>> matplotlib.use('agg') >>> print (matplotlib.rcParams['backend']) agg