@@ -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 ) -> None :
32+ def _matplotlib_plot (self , output_name : str , block : bool ) -> None :
3333 """Plot the saliencies of a particular output in matplotlib"""
3434
3535 @abstractmethod
@@ -44,7 +44,7 @@ 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 ) -> None :
47+ def plot (self , output_name = None , render_bokeh = False , block = True ) -> None :
4848 """
4949 Plot the found feature saliencies.
5050
@@ -55,15 +55,17 @@ def plot(self, output_name=None, render_bokeh=False) -> None:
5555 be displayed
5656 render_bokeh : bool
5757 (default: false) Whether to render as bokeh (true) or matplotlib (false)
58+ block: bool
59+ (default: true) Whether displaying the plot blocks subsequent code execution
5860 """
5961 if output_name is None :
6062 for output_name_iterator in self .saliency_map ().keys ():
6163 if render_bokeh :
6264 show (self ._get_bokeh_plot (output_name_iterator ))
6365 else :
64- self ._matplotlib_plot (output_name_iterator )
66+ self ._matplotlib_plot (output_name_iterator , block )
6567 else :
6668 if render_bokeh :
6769 show (self ._get_bokeh_plot (output_name ))
6870 else :
69- self ._matplotlib_plot (output_name )
71+ self ._matplotlib_plot (output_name , block )
0 commit comments