Skip to content

Instantly share code, notes, and snippets.

@sancau
Created September 24, 2019 13:30
Show Gist options
  • Save sancau/cb7c0c3d1caa09eae6334e974b21fc07 to your computer and use it in GitHub Desktop.
Save sancau/cb7c0c3d1caa09eae6334e974b21fc07 to your computer and use it in GitHub Desktop.
Common Jupyter notebook init cell contents. Hide code toggle, make it wide, matplotlib inline
%matplotlib inline
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
HTML("""
<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
code_show = !code_show
}
$( document ).ready(code_toggle);
</script>
The raw code for this IPython notebook is by default hidden for easier reading.
To toggle on/off the raw code, click <a href="javascript:code_toggle()">here</a>.
""")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment