diff --git a/datascience/tables.py b/datascience/tables.py index 51298c88..79b11c3f 100644 --- a/datascience/tables.py +++ b/datascience/tables.py @@ -3183,7 +3183,7 @@ def interactive_plots(cls): >>> table.plot('days') # doctest: +SKIP """ - global _INTERACTIVE_PLOTS + _INTERACTIVE_PLOTS = True if go is None or make_subplots is None: cls._import_plotly() @@ -3217,7 +3217,7 @@ def static_plots(cls): >>> table.plot('days') # doctest: +SKIP """ - global _INTERACTIVE_PLOTS + _INTERACTIVE_PLOTS = False def plot(self, column_for_xticks=None, select=None, overlay=True, width=None, height=None, **vargs): @@ -3265,7 +3265,7 @@ def plot(self, column_for_xticks=None, select=None, overlay=True, width=None, he >>> table.plot('days', 'price') # doctest: +SKIP """ - global _INTERACTIVE_PLOTS + if _INTERACTIVE_PLOTS: return self.iplot(column_for_xticks, select, overlay, width, height, **vargs) @@ -3586,7 +3586,7 @@ def bar(self, column_for_categories=None, select=None, overlay=True, width=None, See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.bar for additional arguments that can be passed into vargs. """ - global _INTERACTIVE_PLOTS + if _INTERACTIVE_PLOTS: show = vargs.pop('show', True) return self.ibar( @@ -3780,7 +3780,7 @@ def barh(self, column_for_categories=None, select=None, overlay=True, width=None >>> t.barh('Furniture', make_array(1, 2)) # doctest: +SKIP """ - global _INTERACTIVE_PLOTS + if _INTERACTIVE_PLOTS: show = vargs.pop('show', True) return self.ibarh( @@ -4015,7 +4015,7 @@ def scatter(self, column_for_x, select=None, overlay=True, fit_line=False, >>> table.scatter('x', fit_line=True) # doctest: +SKIP """ - global _INTERACTIVE_PLOTS + if _INTERACTIVE_PLOTS: return self.iscatter( column_for_x = column_for_x, @@ -4404,7 +4404,7 @@ def scatter3d(self, column_for_x, column_for_y, select=None, overlay=True, fit_l