@@ -29,7 +29,7 @@ def saliency_map(self):
2929 """Return the Saliencies as a dictionary, keyed by output name"""
3030
3131 @abstractmethod
32- def _matplotlib_plot (self , output_name : str , block : bool ) -> None :
32+ def _matplotlib_plot (self , output_name : str , block : bool , call_show : bool ) -> None :
3333 """Plot the saliencies of a particular output in matplotlib"""
3434
3535 @abstractmethod
@@ -44,7 +44,9 @@ def _get_bokeh_plot_dict(self) -> Dict[str, bokeh.models.Plot]:
4444 for output_name in self .saliency_map ().keys ()
4545 }
4646
47- def plot (self , output_name = None , render_bokeh = False , block = True ) -> None :
47+ def plot (
48+ self , output_name = None , render_bokeh = False , block = True , call_show = True
49+ ) -> None :
4850 """
4951 Plot the found feature saliencies.
5052
@@ -57,15 +59,19 @@ def plot(self, output_name=None, render_bokeh=False, block=True) -> None:
5759 (default= `False`) If true, render plot in bokeh, otherwise use matplotlib.
5860 block: bool
5961 (default= `True`) Whether displaying the plot blocks subsequent code execution
62+ call_show: bool
63+ (default= 'True') Whether plt.show() will be called by default at the end of the
64+ plotting function. If `False`, the plot will be returned to the user for further
65+ editing.
6066 """
6167 if output_name is None :
6268 for output_name_iterator in self .saliency_map ().keys ():
6369 if render_bokeh :
6470 show (self ._get_bokeh_plot (output_name_iterator ))
6571 else :
66- self ._matplotlib_plot (output_name_iterator , block )
72+ self ._matplotlib_plot (output_name_iterator , block , call_show )
6773 else :
6874 if render_bokeh :
6975 show (self ._get_bokeh_plot (output_name ))
7076 else :
71- self ._matplotlib_plot (output_name , block )
77+ self ._matplotlib_plot (output_name , block , call_show )
0 commit comments