Take a simple example which displays the bar chart with axes
import pandas as pd
import matplotlib.pyplot as plt
s = pd.Series([1, 2, 3])
fig, ax = plt.subplots(tight_layout=True)
plot = s.plot.bar()
However when save the chart using...
fig.savefig('ex.png', format='png', bbox_inches='tight')
...the saved chart has the axes cut off. If I try plot.get_figure()
the result is the same.
How can I get the axes produced by pandas.plot into the figure so I can then save the chart to file?