/customize-jupyter-notebook

Guide to customize jupyter notebook

Primary LanguageCSS

Customize your jupyter notebook

Adding custom theme

First we have to install jupyterthemes

Install with pip

# install jupyterthemes
pip install jupyterthemes

# upgrade to latest version
pip install --upgrade jupyterthemes

for more info refer the docs

Applying theme

jt -t onedork -altp -tfs 11 -nfs 115 -cellw 88% -T -N -cursc p -f firacode -dfs 10 -fs 14 -ofs 11

refer docs for understanding each flag

also I have modified css for tooltip and completions in custom.css copy and paste at ~/.jupyter/custom/custom.css

Adding styles for Plots

Include the following in ~/.ipython/profile_default/startup/startup.ipy file to set plotting style automatically whenever you start a notebook

# import jtplot module in notebook
from jupyterthemes import jtplot

# choose which theme to inherit plotting style from
# onedork | grade3 | oceans16 | chesterish | monokai | solarizedl | solarizedd
jtplot.style(theme='onedork')

# set "context" (paper, notebook, talk, poster)
# scale font-size of ticklabels, legend, etc.
# remove spines from x and y axes and make grid dashed
jtplot.style(context='talk', fscale=1.4, spines=False, gridlines='--')

# turn on X- and Y-axis tick marks (default=False)
# turn off the axis grid lines (default=True)
# and set the default figure size
jtplot.style(ticks=True, grid=False)

Note: I had this problem of styles not getting applied for plots I solved it by installing jupyterthemes through Anaconda terminal

Adding Extensions

conda install -c conda-forge jupyter_contrib_nbextensions  jupyter_nbextensions_configurator

then

jupyter nbextensions_configurator enable --user

now restart/start Jupyter Notebook and you should be seeing a new tab to enable/disable extensions.

for example:

to enable autocompletion

jupyter nbextension enable hinterland/hinterland

and more extensions available to enhance your productivity look at the image below

extension-tab