This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
def isnotebook(): | ||
""" | ||
see: https://stackoverflow.com/a/39662359/1046449 | ||
""" | ||
try: | ||
shell = get_ipython().__class__.__name__ | ||
return shell == 'ZMQInteractiveShell' | ||
# return True # Jupyter notebook or qtconsole | ||
#elif shell == 'TerminalInteractiveShell': | ||
# return False # Terminal running IPython | ||
#else: | ||
# return False # Other type (?) | ||
except NameError: | ||
return False # Probably standard Python interpreter | ||
|
||
if isnotebook(): | ||
from .notebook import * | ||
else: | ||
from .console import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,8 @@ | |
|
||
__all__ = ['plt',] | ||
|
||
from ..session_logs import * | ||
logger.info(__file__) | ||
|
||
import matplotlib.pyplot as plt | ||
plt.ion() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
""" | ||
Configure matplotlib in interactive mode for Jupyter notebook | ||
""" | ||
|
||
__all__ = ['plt',] | ||
|
||
from ..session_logs import * | ||
logger.info(__file__) | ||
|
||
# %matplotlib notebook | ||
get_ipython().magic('matplotlib notebook') | ||
import matplotlib.pyplot as plt | ||
plt.ion() |