Home

Awesome

jupyterthemes

Theme-ify your Jupyter Notebooks!

AuthorVersionStatusDemo
Kyle DunovanimageimageBinder

Updates


Scaling Back Support:

As anyone who has opened a bug report or feature request in the last several years can attest, I have begun scaling back support for the jupyter-themes package - mostly due to my personal preference for using Jupyter Lab over Jupyter Notebook classic (see update below for two of my JupyterLab theme repos). Thank you to everyone who contributed to jupyter-themes.

JupyterLab Themes:

JupyterLab themes with similar style/design conventions to jupyter-themes:

JupyterLab v3.0
JupyterLab v4.0

JT Customizable Features

plotting style

image

markdown/equations

image

pandas dataframes

image

command palette

image

Links

Requirements

Install with pip

# install jupyterthemes
pip install jupyterthemes

# upgrade to latest version
pip install --upgrade jupyterthemes

Install with conda

# install jupyterthemes
conda install -c conda-forge jupyterthemes

# update to latest version
conda update jupyterthemes

Known issues

Command Line Usage

jt  [-h] [-l] [-t THEME] [-f MONOFONT] [-fs MONOSIZE] [-nf NBFONT]
    [-nfs NBFONTSIZE] [-tf TCFONT] [-tfs TCFONTSIZE] [-dfs DFFONTSIZE]
    [-m MARGINS] [-cursw CURSORWIDTH] [-cursc CURSORCOLOR] [-vim]
    [-cellw CELLWIDTH] [-lineh LINEHEIGHT] [-altp] [-altmd] [-altout]
    [-P] [-T] [-N] [-r] [-dfonts]

Description of Command Line options

cl optionsargdefault
Usage help-h--
List Themes-l--
Theme Name to Install-t--
Code Font-f--
Code Font-Size-fs11
Notebook Font-nf--
Notebook Font Size-nfs13
Text/MD Cell Font-tf--
Text/MD Cell Fontsize-tfs13
Pandas DF Fontsize-dfs9
Output Area Fontsize-ofs8.5
Mathjax Fontsize (%)-mathfs100
Intro Page Margins-mauto
Cell Width-cellw980
Line Height-lineh170
Cursor Width-cursw2
Cursor Color-cursc--
Alt Prompt Layout-altp--
Alt Markdown BG Color-altmd--
Alt Output BG Color-altout--
Style Vim NBExt*-vim--
Toolbar Visible-T--
Name & Logo Visible-N--
Kernel Logo Visible-kl--
Reset Default Theme-r--
Force Default Fonts-dfonts--

Command Line Examples

# list available themes
# onedork | grade3 | oceans16 | chesterish | monokai | solarizedl | solarizedd
jt -l

# select theme...
jt -t chesterish

# restore default theme
# NOTE: Need to delete browser cache after running jt -r
# If this doesn't work, try starting a new notebook session.
jt -r

# toggle toolbar ON and notebook name ON
jt -t grade3 -T -N

# toggle kernel logo.  kernel logo is in same container as name
# toggled with -N.  That means that making the kernel logo visible is
# pointless without also making the name visible
jt -t grade3 -N -kl

# set code font to 'Roboto Mono' 12pt
# (see monospace font table below)
jt -t onedork -f roboto -fs 12

# set code font to Fira Mono, 11.5pt
# 3digit font-sizes get converted into float (115-->11.5)
# 2digit font-sizes > 25 get converted into float (85-->8.5)
jt -t solarizedd -f fira -fs 115

# set font/font-size of markdown (text cells) and notebook (interface)
# see sans-serif & serif font tables below
jt -t oceans16 -tf merriserif -tfs 10 -nf ptsans -nfs 13

# adjust cell width (% screen width) and line height
jt -t chesterish -cellw 90% -lineh 170

# or set the cell width in pixels by leaving off the '%' sign
jt -t solarizedl -cellw 860

# fix the container-margins on the intro page (defaults to 'auto')
jt -t monokai -m 200

# adjust cursor width (in px) and make cursor red
# options: b (blue), o (orange), r (red), p (purple), g (green), x (font color)
jt -t oceans16 -cursc r -cursw 5

# choose alternate prompt layout (narrower/no numbers)
jt -t grade3 -altp

# my two go-to styles
# dark
jt -t onedork -fs 95 -altp -tfs 11 -nfs 115 -cellw 88% -T
# light
jt -t grade3 -fs 95 -altp -tfs 11 -nfs 115 -cellw 88% -T

Set Plotting Style (from within notebook)

jtplot.style() makes changes to matplotlib's rcParams dictionary so that figure aesthetics match those of a chosen jupyterthemes style. In addition to setting the color scheme, jtplot.style() allows you to control various figure properties (spines, grid, font scale, etc.) as well as the plotting "context" (borrowed from seaborn).

Note, these commands do not need to be re-run every time you generate a new plot, just once at the beginning of your notebook or whenever style changes are desired after that.

Pro-tip: Include the following two lines in ~/.ipython/profile_default/startup/startup.ipy file to set plotting style automatically whenever you start a notebook:

# import jtplot submodule from jupyterthemes
from jupyterthemes import jtplot

# currently installed theme will be used to
# set plot style if no arguments provided
jtplot.style()

jtplot.style() Examples

# 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, figsize=(6, 4.5))

# reset default matplotlib rcParams
jtplot.reset()

Monospace Fonts (code cells)

-f argMonospace Font
ankaAnka/Coder
anonymousAnonymous Pro
aurulentAurulent Sans Mono
bitstreamBitstream Vera Sans Mono
bpmonoBPmono
codeCode New Roman
consolamonoConsolamono
cousineCousine
dejavuDejaVu Sans Mono
droidmonoDroid Sans Mono
firaFira Mono
firacodeFira Code
genericGeneric Mono
hackHack
haskligHasklig
inconsolataInconsolata-g
inputmonoInput Mono
iosevkaIosevka
liberationLiberation Mono
mesloMeslo
officeOffice Code Pro
oxygenOxygen Mono
robotoRoboto Mono
saxmonosaxMono
sourceSource Code Pro
sourcemedSource Code Pro Medium
sudovarSudo Variable
ptmonoPT Mono
ubuntuUbuntu Mono

Sans-Serif Fonts

-nf/-tf argSans-Serif Font
opensansOpen Sans
droidsansDroid Sans
exosansExo_2
latosansLato
ptsansPT Sans
robotosansRoboto
sourcesansSource Sans Pro

Serif Fonts

-nf/-tf argSerif Font
loraserifLora
ptserifPT Serif
georgiaserifGeorgia
cardoserifCardo
crimsonserifCrimson Text
ebserifEB Garamond
merriserifMerriweather
neutonserifNeuton
goudyserifSorts Mill Goudy