File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11
22import matplotlib
3+ import inspect
34import warnings
45
56# ipython relies on interactive_bk being defined here
@@ -30,11 +31,14 @@ def pylab_setup():
3031 # for "show" or "draw_if_interactive", so if they are not defined
3132 # by the backend, just do nothing
3233 def do_nothing_show (* args , ** kwargs ):
33- warnings .warn ("""
34+ frame = inspect .currentframe ()
35+ fname = inspect .getframeinfo (frame .f_back )[0 ]
36+ if fname in ('<stdin>' , '<ipython console>' ):
37+ warnings .warn ("""
3438Your currently selected backend, '%s' does not support show().
3539Please select a GUI backend in your matplotlibrc file ('%s')
3640or with matplotlib.use()""" %
37- (backend , matplotlib .matplotlib_fname ()))
41+ (backend , matplotlib .matplotlib_fname ()))
3842 def do_nothing (* args , ** kwargs ): pass
3943 backend_version = getattr (backend_mod ,'backend_version' , 'unknown' )
4044 show = getattr (backend_mod , 'show' , do_nothing_show )
You can’t perform that action at this time.
0 commit comments