df_rm_count[['count']].sort_values(by='count', ascending=False).plot.barh()
The above line shows the graph (without plt.show()
)
I'd like to save the plot as image but can't because plot
immediately displays the plot
I tried
%matplotlib
(to negate%matplotlib inline
I getModuleNotFoundError: No module named '_tkinter'
error)- plt.ioff()
- plt.close('all')
- matplotlib.pyplot.close(fig)
- matplotlib.interactive(False)
none of the above worked..
- edit
Agg didn't work either..
import matplotlib as mpl
mpl.use('Agg')
ipykernel_launcher.py:2: UserWarning: This call to matplotlib.use() has no effect because the backend has already been chosen; matplotlib.use() must be called
*before* pylab, matplotlib.pyplot, or matplotlib.backends is imported for the first time.