Reran with tight_layout for interactive plots
This is just so everything looks nice in nbviewer. I added plt.tight_layout() to the interactive_plot context manager, which makes plots fill the output cell better.
This commit is contained in:
@@ -17,28 +17,27 @@ for more information.
|
||||
from __future__ import (absolute_import, division, print_function,
|
||||
unicode_literals)
|
||||
|
||||
|
||||
from book_format import figsize
|
||||
from contextlib import contextmanager
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from contextlib import contextmanager
|
||||
|
||||
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
from book_format import figsize
|
||||
import time
|
||||
|
||||
try:
|
||||
import seaborn
|
||||
except:
|
||||
pass
|
||||
|
||||
sys.path.insert(0, '..')
|
||||
|
||||
|
||||
|
||||
def end_interactive(fig):
|
||||
""" end interaction in a plot created with %matplotlib notebook """
|
||||
import time
|
||||
plt.gcf().canvas.draw()
|
||||
time.sleep(0.1)
|
||||
time.sleep(0.2)
|
||||
plt.close(fig)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user