Skip to content

Commit b53e0c7

Browse files
committed
Hack to have seaborn work reliable
Cc: @agramfort @Titan-C The problem is that, when it loads, seaborn changes the defaults of matplotlib. Thus it create side effects across different examples. Note also the 'plt.rcdefaults()' that I had to add above to avoid interactions between examples
1 parent 43a1aec commit b53e0c7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

_sphinxext/gen_rst.py

+5
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,11 @@ def generate_file_rst(fname, target_dir, src_dir, root_dir, plot_gallery):
805805
os.chdir(cwd)
806806
sys.stdout = orig_stdout
807807
plt.rcdefaults()
808+
# Horrible code to 'unload' seaborn, so that it resets
809+
# its default when is load
810+
for module in sys.modules.keys():
811+
if 'seaborn.' in module:
812+
del sys.modules[module]
808813

809814
print " - time elapsed : %.2g sec" % time_elapsed
810815
else:

0 commit comments

Comments
 (0)