• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Crypto Currency
  • Technology
  • Contact
NEO Share

NEO Share

Sharing The Latest Tech News

  • Home
  • Artificial Intelligence
  • Machine Learning
  • Computers
  • Mobile
  • Crypto Currency

Customize your Jupyter Notebook Theme in 2 lines of code

December 15, 2020 by systems

Customizable themes, fonts, toolbar for Jupyter Notebook

Satyam Kumar
Photo by Pakata Goh on Unsplash

The interface themes define the appearance of the windows, buttons, toolbar, cells, and all visual elements of the user interface. By default, Jupyter Notebook uses the light theme. Some of the programmers or data scientists like to use some dark themes or other themes on different platform such as PyCharm, Spyder, etc.

Jupyter Notebook does not come up with an inbuilt option to change the theme of the notebook. In this article, you can read how to change the theme of your jupyter notebook, enable/disable toolbars, and customize your notebook according to your need.

(Image by Author), The default theme in Jupyter Notebook

Installation:

Jupyter themes is an open-source library developed by Kyle Dunovan used to change themes, plotting style, fonts in the jupyter notebook. You can install Jupiter themes using pip:

# install jupyterthemes
pip install jupyterthemes

# upgrade to latest version
pip install --upgrade jupyterthemes

By default, Jupyter Notebook uses a light theme as mentioned in the below image. Notebook themes are customizable along with toolbars, text and code fonts, and other elements of the user interface. To view the list of available themes in jupyterthemes package use command line usage !jt -l:

Usage to change notebook theme:

Command-line statement to change the theme of the notebook:

!jt -t [theme name]
(Image by Author), Representation of different themes

To restore the default theme of the notebook, run the command line statement as !jt -r

When the theme of the notebook is changed to the above-mentioned themes, the toolbar, filename, kernel logo, is hidden by default. You can enable these options by changing the command line statement.

Enable the toolbar: !jt -t [theme name] -T

Enable the filename and logo: !jt -t [theme name] -N

Enable the kernel logo: !jt -t [theme name] -kl

To change the theme and enable the toolbar, filename, logo, kernel logo in same command line statement: !jt -t [theme name] -T -N -kl

Jupyter themes provide features to change code font, code font size, notebook font, notebook font size, pandas data frame font size, etc.

(Image by Author),

Command Line Usage: !jt [arg] [FONT or FONTSIZE]

Other customizable options in Jupyter themes:

General Command Line statement:

!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]

Change the plotting style with Notebook using Jupyter Themes:

jtplot.style() makes changes to matplotlib library rcParams dictionary so that figure aesthetics match with the chosen jupyter themes. In addition to setting the color scheme, jtplot.style() allows controlling various figure properties such as spines, grid, font scale, etc. as well as the plotting “context”.

(Code by Author), Plotting style using Jupyter Themes
Note:
jtplot style commands need to run just once in the notebook, not every time before generating the plot

Filed Under: Artificial Intelligence

Primary Sidebar

Stay Ahead: The Latest Tech News and Innovations

Cryptocurrency Market Updates: What’s Happening Now

Emerging Trends in Artificial Intelligence: What to Watch For

Top Cloud Computing Services to Secure Your Data

The Future of Mobile Technology: Recent Advancements and Predictions

Footer

  • Privacy Policy
  • Terms and Conditions

Copyright © 2025 NEO Share

Terms and Conditions - Privacy Policy