MITB Banner

What Are Jupyter Themes And How To Apply Them?

Share

jupyter themes

Jupyter themes are a great way to beautify your notebook and get a dark mode, which is popular among programmers. Jupyter Notebook, unlike other editors/IDEs by default, has a white background. This can be annoying for people who like to code for extended hours. However, you can change the theme of your notebook from a wide range of available options.

Jupyter Notebook, although not an integrated development environment, is popular among data scientists for analysing, visualising, and communicating the data findings. As per the Python Developer Survey 2019, Jupyter Notebook was only behind PyCharm and VS Code in the most popular editor/IDE category. Over the years, Jupyter Notebook has become the go-to editor for data scientists due to its ease-of-use and effectiveness in working with various environments, which can be created using Conda, Docker, or Virtualenv.

However, Jupyter Notebook is losing its popularity as data scientists are now embracing IDEs that can manage end-to-end machine learning workflows. But, Jupyter Notebook is still popular among researchers who are less concerned about writing production-level code and more about innovating.

Also Read: Top 5 Online Resources To Learn Jupyter Notebook

Jupyter Themes

The themes can be used to change not only background colour but also the style of the text. Besides, you can also customise the text in markdown, pandas’ dataframe font size, cell width and height, cursor colour, visibility of toolbar, and more. Furthermore, you can set the plotting style with jtplot.style() to beautify your visualisations generated with matplotlib. One can also mould figure properties like grid, spines, and more.

Installing Jupyter Themes 

Before applying from the available themes, you will have to install the themes from the package managers of your choice — pip or conda.

With pip:

pip install jupyterthemes

With Conda:

conda install -c conda-forge jupyterthemes

On using conda command in Anaconda Prompt, you will see a list of packages that are to be installed. However, your list of necessary packages might slightly vary if you already have some of the required packages.

After successfully installing packages, you can either change the theme right from the Anaconda Prompt or can directly start Jupyter Notebook and then apply the theme.

Currently, there are 9 themes available, which you can see with the below command:

jt -l

You will see a list of themes: chesterish, grade3, gruvboxd, gruvboxl, manokai, oceans16, onedork, solarizedd, solarizedl.

However, you can use the above command with ‘!’ in the beginning on the notebook to check the list: i.e.: !jt -l 

Now you can select from the list and apply it using the below command within the Anaconda Prompt:

jt -t <name of the theme>

For e.g.: jt -t chesterish

Now, start the Jupyter Notebook from Anaconda Prompt with the below command:

jupyter notebook

Jupyter notebook with the chesterish theme below: 

By default, the theme hides the toolbar and notebook’s name. But you can toggle it with the below command:

jt -t grade3 -T -N (to display the toolbar and notebook’s name)

You can also reverse the theme within the notebook:

!jt -r

However, you will have to refresh your notebook to see the changes.

Some of the other customisations that you can try are: –

Changing the font: !jt -t solarizedd -f fira -fs 115

Adjusting cell width: !jt -t chesterish -cellw 90% -linech 170

Cursor width and colour: !jt -t oceans16 -cursc r -cursw 5

Plotting With The Theme

The jupyterthemes library also allows you to make appealing visualisation with its submodule jtplot. Import the module and use its style() method to change figure properties.

#import the module
from jupyterthemes import jtplot

Examples of how the style() method can be used to beautify your visualisation: –

Outlook

Jupyter themes are an effective way to change the aesthetics of your notebook by making the most out of the available themes. One of the prime reasons behind the popularity of the themes is the feature to modify your plots created through matplotlib. With the jupyterthemes library, you can take your visualisation to the next level.

Link to the jupyterthemes’ GitHub repository.

Share
Picture of Rohit Yadav

Rohit Yadav

Rohit is a technology journalist and technophile who likes to communicate the latest trends around cutting-edge technologies in a way that is straightforward to assimilate. In a nutshell, he is deciphering technology. Email: rohit.yadav@analyticsindiamag.com
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India

Subscribe to Our Newsletter

The Belamy, our weekly Newsletter is a rage. Just enter your email below.