How to Change the Theme in Jupyter Notebook
Last Updated :
10 May, 2024
In this article, we will cover how to change the theme in Jupyter Notebook. We will look at what is Jupyter notebook, the themes why we use them, and the different themes available in Jupyter Notebook we will look into examples along with the screenshots to get a better understanding. We will also see how can we customize our theme.
The Jupyter Notebook is the original web application for creating and sharing computational documents that contain live code, equations, visualizations, and narrative text. It offers a simple, streamlined, document-centric experience. Jupyter has support for over 40 different programming languages and Python is one of them.
Change the Theme in Jupyter Notebook
A Jupyter Notebook theme is a pre-defined set of styles like background color, font style, font color, etc. which determines the visual appearance of the Jupyter Notebook interface. By default, Jupyter Notebook uses a light theme, but generally, developers prefer dark themes while working in long coding sessions which helps them to reduce eye strain and makes the visual interface more appealing there are a lot of themes that we discuss later in this article.
Importance of Themes in Jupyter Notebook
- Reduce eye strain: While working in long coding sessions or working in low-light environments they can strain your eyes and hence to reduce eye strain there are different themes available to match the light of your environment.
- Readability: Themes are designed in such a way that enhances the readability of the interface making it easier for color blind and visually impaired persons.
- Personalization: Themes provide a more personal look to the user and make the application more user-friendly.
Jupyter Notebook Themes
To install jupyter notebook themes - open the terminal and run the following command:
pip install jupyterthemes
If you have already install jupyter themes and want to upgrade them run the below command in terminal,
pip install --upgrade jupyterthemes
List all the available themes - To list all the available theme run the following command in terminal,
jt -l
Available themes:
Below are the list that we can use Theme in Jupyter Notebook:
- chesterish
- grade3
- gruvboxd
- gruvboxl
- monokai
- oceans16
- onedork
- solarizedd
- solarizedl
Syntax to Apply Themes in Jupyter Notebook
To apply theme to the jupyter notebook the command syntax is as follows:
!jt -t [theme name]
After applying theme you need to restart the Jupyter Notebook to see the changes.
To reset to the default theme of Jupyter Notebook use the following command,
jt -r
Example 1: Applying Monokai Theme
!jt -t monokai
MonokaiExample 2: Applying grade3 Theme
!jt -t grade3
grade3Example 3: Applying onedork Theme
!jt -t onedork

Example 4: Applying Chesterish Theme
!jt -t chesterish

Customize Theme in Jupyter Notebook
There are different command line options available in jt command to customize the theme which are as follows:
!jt -t [theme name] -f [font name] -fs [font size] . . .
|
-f
| Code Font
|
-fs
| Code Font-Size
|
-nf
| Notebook Font
|
-nfs
| Notebook Font Size
|
-tf
| Text/MD Cell Font
|
-tfs
| Text/MD Cell Fontsize
|
-cellw
| Cell Width
|
-lineh
| Line Height
|
-cursw
| Cursor Width
|
-cursc
| Cursor Color
|
-T
| Toolbar Visible
|
Example: Applying the different themes simultaneously and also changing the font size, code cell width.
!jt -t monokai -f roboto -fs 16 -cellw 80% -T
- -t monokai sets the theme to Monokai
- -f roboto sets the font to Roboto Mono
- -fs 16 sets the font size to 16 px
- -cellw 80% sets the code cell width to 80% of the screen width
- -T enables the toolbar
customized theme
Similar Reads
How to Add a Table of Contents in the Jupyter Notebook
In this article, we will cover How to add a table of contents to the Jupyter Notebook. First, we look at what Jupyter Notebook and table of contents and why we use them, followed by a step-by-step tutorial to add a table of contents to the Jupyter Notebook. Jupyter NotebookThe Jupyter Notebook is th
4 min read
How to Add R to Jupyter Notebook ?
Although Jupyter has an R studio for R Programming Language, many people prefer to work in the Jupyter Notebook as it is convenient to use. Add r in Jupyter Notebook we start with our system, which should have Anaconda installed. So, now let's set up the Jupyter Notebook for the R Programming Langua
1 min read
How to Write and Run Code in Jupyter Notebook
Jupyter Notebook is an open-source web application. It allows to generate and share documents that contain live code, equations, visualized data, and many more features. Nowadays it has become the first choice of many of the data scientists due to it's immense data visualization and analysis capabil
7 min read
How to run an .ipynb Jupyter Notebook from terminal?
Let's see how to run Notebook in Jupyter from a terminal in this article, but first, let's get a sense of what these terms mean. Python: Python is a versatile and high-level programming language known for its readability and extensive libraries, making it a popular choice for web development, data a
2 min read
How to Hide all Codes in Jupyter Notebook
Jupyter Notebooks have become indispensable tools for data scientists, researchers, and educators alike. They provide an interactive and dynamic environment for writing code, documenting processes, and presenting results. However, when it comes to sharing your work, particularly in lectures or prese
4 min read
How to upload a dataset in Jupyter Notebook?
Jupyter Notebook is a web-based powerful IDE tool that helps with data analysis, visualization and narrative multi-media. Uploading a dataset is a very common task when working in the Jupyter Notebook. It is widely used by data analysts, data scientists, researchers and other developers to perform d
4 min read
How To Delete Cell In Jupiter Notebook
Jupyter Notebook is a powerful tool for developers. Jupyter is an open-source web application that contains both code and text elements such as figures, questions, pictures, etc. Jupiter's main meaning is Julia, Python, and Ruby. Jupyter Notebook is a web-based computational environment for creating
3 min read
How to Optimize Jupyter Notebook Performance ?
IntroductionJupiter Notebook is one of the best (if not the best) online applications/environments which is used heavily to do tasks related to Data Analysis, Data Science, Machine Learning, Deep Learning, etc. in Python. Jupyter Notebook doesn't need to be installed locally, it can be run entirely
10 min read
How to work with Julia on Jupyter Notebook?
Julia is a programming language that uses multiple dispatches as a feature where a method or a function can be dynamically dispatched based on the requirement. It is a high performance and a dynamic language which makes it user-interactive. It has a high-level syntax which makes it easy to learn and
3 min read
How to Run Jupyter Notebooks from a Remote Server?
Jupyter Notebook is an open-source, interactive web application that allows you to write and run computer code in over 40 programming languages, including Python, R, Julia, and Scala. In this article, we will see how we can Jupyter Notebook with a configured server instead of localhost. Run Jupyter
2 min read