Bored of jupyter notebooks | Try out some new themes

leangaurav
2 min readFeb 15, 2023

Jupyter notebook has a plugin available called jupyterthemes.

This wonderful plugin allows you to customize your notebook theme by installing pre created themes or create your own themes. Lets see how to use some new themes.

Step-1: Install jupyter themes

Install from a notebook itself

!pip install jupyterthemes

OR Install from terminal using pip

pip install jupyterthemes

OR Install from terminal using conda

conda install -c conda-forge jupyterthemes

Step-2: List default themes

In Terminal

jt -l

# OUTPUT
#Available Themes:
# chesterish
# grade3
# gruvboxd
# gruvboxl
# monokai
# oceans16
# onedork
# solarizedd
# solarizedl

OR In Jupyter Notebook

import jupyterthemes as jt
jt.get_themes()

# OUTPUT
['chesterish',
'grade3',
'gruvboxd',
'gruvboxl',
'monokai',
'oceans16',
'onedork',
'solarizedd',
'solarizedl']

Step-3: Preview or try out a theme

In a notebook, paste this and execute once

import jupyterthemes as jt
from jupyterthemes.stylefx import set_nb_theme

it = iter(jt.get_themes())

In next cell paste below code and execute again and again to switch to next theme.

theme = next(it)
print("Current Theme: ", theme)
set_nb_theme(theme)

Step-4: Apply the theme permanently

From terminal run below command. Replace chesterish with your favorite theme.

jt -t chesterish

OR In a notebook

!jt -t chesterish

Step-5: Restart your notebook and enjoy

If you wish to get back to the default theme. Remove the theme using below command and restart jupyter notebook.

Plus if you are using jupyter lab, you can switch themes from menu.

--

--

leangaurav

Engineer | Trainer | writes about Practical Software Engineering | Find me on linkedin.com/in/leangaurav | Discuss anything topmate.io/leangaurav