Try this :
fig = class_counts.plot(kind='bar',
figsize=(20, 16), fontsize=26).get_figure()
fig.savefig('test.pdf')
Try this :
fig = class_counts.plot(kind='bar',
figsize=(20, 16), fontsize=26).get_figure()
fig.savefig('test.pdf')