Hello @mamos so there is a workaround this. You would need to make some changes to the original plot functions. I have this code written up for you. put this function at the end of your cerebro initialization and you should be good.
def saveplots(cerebro, numfigs=1, iplot=True, start=None, end=None,
width=16, height=9, dpi=300, tight=True, use=None, file_path = '', **kwargs):
from backtrader import plot
if cerebro.p.oldsync:
plotter = plot.Plot_OldSync(**kwargs)
else:
plotter = plot.Plot(**kwargs)
figs = []
for stratlist in cerebro.runstrats:
for si, strat in enumerate(stratlist):
rfig = plotter.plot(strat, figid=si * 100,
numfigs=numfigs, iplot=iplot,
start=start, end=end, use=use)
figs.append(rfig)
for fig in figs:
for f in fig:
f.savefig(file_path, bbox_inches='tight')
return figs
saveplots(cerebro, file_path = 'savefig.png') #run it