@@ -866,7 +866,7 @@ def getbroker(self):
866866
867867 def plot (self , plotter = None , numfigs = 1 , iplot = True , start = None , end = None ,
868868 savefig = False , figfilename = 'backtrader-plot-{j}-{i}.png' ,
869- width = 16 , height = 9 , dpi = 300 , tight = True ,
869+ width = 16 , height = 9 , dpi = 300 , tight = True , use = None ,
870870 ** kwargs ):
871871 '''
872872 Plots the strategies inside cerebro
@@ -880,6 +880,9 @@ def plot(self, plotter=None, numfigs=1, iplot=True, start=None, end=None,
880880 ``iplot``: if ``True`` and running in a ``notebook`` the charts will be
881881 displayed inline
882882
883+ ``use``: set it to the name of the desired matplotlib backend. It will
884+ take precedence over ``iplot``
885+
883886 ``start``: An index to the datetime line array of the strategy or a
884887 ``datetime.date``, ``datetime.datetime`` instance indicating the start
885888 of the plot
@@ -924,7 +927,7 @@ def plot(self, plotter=None, numfigs=1, iplot=True, start=None, end=None,
924927 for si , strat in enumerate (stratlist ):
925928 rfig = plotter .plot (strat , figid = si * 100 ,
926929 numfigs = numfigs , iplot = iplot ,
927- start = start , end = end , savefig = savefig )
930+ start = start , end = end , use = use )
928931 # pfillers=pfillers2)
929932
930933 figs .append (rfig )
0 commit comments