python - ipython notebook matplotlib plot for dataframe throwing non gui exception -
when try plot dataframe in notbook , seeing 'non gui' exception being thrown.
import pandas pd import sys,os import numpy np import matplotlib.pyplot plt %matplotlib inline %pylab inline ts = pd.series(np.random.randn(1000), index=pd.date_range('1/1/2000', periods=1000)) df = pd.dataframe(np.random.randn(1000, 4), index=ts.index, columns=list('abcd')) df = df.cumsum() plt.figure(); df.plot(); #<-- exception here
there plot displayed , first column of df
plotted , see exception. when try plot series , dont see issue. here exception trace :
(looks trying plot df 'interactive' plot, there other function / parameter try not 'interactive')
...\anaconda2\lib\site-packages\pandas\tools\plotting.pyc in __call__(self, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds) ...\anaconda2\lib\site-packages\pandas\tools\plotting.pyc in plot_frame(data, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds) ...\anaconda2\lib\site-packages\pandas\tools\plotting.pyc in _plot(data, x, y, subplots, ax, kind, **kwds) ...\anaconda2\lib\site-packages\pandas\tools\plotting.pyc in generate(self) ...\anaconda2\lib\site-packages\pandas\tools\plotting.pyc in _make_plot(self) ...\anaconda2\lib\site-packages\pandas\tools\plotting.pyc in _ts_plot(cls, ax, x, data, style, **kwds) ...\anaconda2\lib\site-packages\pandas\tseries\plotting.pyc in format_dateaxis(subplot, freq) ...\anaconda2\lib\site-packages\ipython\utils\decorators.pyc in wrapper(*args, **kw) ...\anaconda2\lib\site-packages\matplotlib\backends\backend_tkagg.pyc in draw_if_interactive() 68 figmanager = gcf.get_active() 69 if figmanager not none: ---> 70 figmanager.show() 71 72 class show(showbase): ...\anaconda2\lib\site-packages\matplotlib\backend_bases.pyc in show(self) 2618 optional warning. 2619 """ -> 2620 raise nonguiexception() 2621 2622 def destroy(self): nonguiexception:
Comments
Post a Comment