I'm using the data frame plot function to create the following plot: Using the following code:
data.groupby(['age']).agg(np.size)['listener_id'].plot(kind='bar')
How can I save this plot?
The pandas plotting function wraps matplotlib. You can save these using something like
plt.savefig('<filename>.png')
Try this:
bplot = data.groupby(['age']).agg(np.size)['listener_id'].plot(kind='bar')
fig = bplot.get_figure()
fig.savefig("test.png")