Cant save figures to files
Rudra-J opened this issue · comments
Rudra Joshi commented
Problem Description
I am unable to save these pyfolio plots to files locally on my pc
def fig2img(self,fig):
buf = io.BytesIO()
fig.savefig(buf)
buf.seek(0)
img = Image.open(buf)
return img
Please provide the full traceback:
plt.figure(figsize=(15, 6))
fig=pyfolio.plot_rolling_sharpe(pnl_df_eod['returns'])
img = self.fig2img(fig)
ppath=os.path.join(path,'rolling_sharpe.png')
img.save(ppath)
Please provide any additional information below:
The error that is displayed is {'Axes' object has no attribute 'savefig'}
Versions
- Pyfolio version:
- Python version:
- Pandas version:
- Matplotlib version: