Fundamentals 8 min read

Create a Stunning Jupyter Notebook Setup: Install, Configure, and Customize

This guide walks you through installing Jupyter via Anaconda, configuring IPython profiles, customizing Matplotlib for inline and Chinese font support, optimizing Retina displays, tweaking notebook CSS, and adding useful extensions like nbextensions and dashboards to create a polished, production‑ready environment.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Create a Stunning Jupyter Notebook Setup: Install, Configure, and Customize

It’s time to break the cycle of repetitive work and set up a beautiful Jupyter environment.

Install Jupyter

Simply install Anaconda, which includes Jupyter.

Example environment:

python: 3.5.*

macOS: 10.12.4

Test the installation:

jupyter notebook

Configure IPython

Create a profile so that common imports load automatically: ipython profile create This creates ~/.ipython/profile_default/ with two files: ipython_config.py – runs for any IPython kernel. ipython_notebook_config.py – runs when a notebook starts.

Edit the desired config file and add: c = get_config() Then set the exec_lines attribute to import the libraries you need, for example:

c.InteractiveShellApp.exec_lines = [
    "import pandas as pd",
    "import numpy as np",
    "import scipy.stats as spstats",
    "import scipy as sp"
]

Configure Matplotlib

Enable inline plotting: %matplotlib inline Or add to the config: c.IPKernelApp.matplotlib = 'inline' Include the same imports as above, adding Matplotlib:

c.InteractiveShellApp.exec_lines = [
    "import pandas as pd",
    "import numpy as np",
    "import scipy.stats as spstats",
    "import scipy as sp",
    "import matplotlib.pyplot as plt"
]

Display Chinese Characters in Matplotlib

For Python 2.7, set the default encoding:

import sys
reload(sys)
sys.setdefaultencoding('utf8')

For Python 3, set the environment variable instead: export PYTHONIOENCODING="utf8" Or launch Jupyter with it: PYTHONIOENCODING="utf8" jupyter notebook Find a font that supports Chinese (e.g., Noto Sans CJK SC) and set it as the default:

import matplotlib as mpl
mpl.rc('font', family='Noto Sans CJK SC')

If you use Seaborn, ensure it does not overwrite the font setting:

import seaborn as sns
sns.set_style('ticks', {'font.family': ['Noto Sans CJK SC']})

Retina Display for Figures

Use the following command for high‑resolution figures: %config InlineBackend.figure_format = 'retina' Or add to the config:

c.InlineBackend.figure_format = 'retina'

Customize Notebook Appearance

Edit ~/.jupyter/custom/custom.css to change width and fonts, for example:

#notebook-container {
    max-width: 830px;
    padding: 40px;
}

pre.CodeMirror-line {
    font-family: 'BlinkMacSystemFont', 'Lucida Grande', 'Segoe UI', Ubuntu, Cantarell, sans-serif;
}

Install Common Jupyter Extensions

Two useful extensions are recommended:

jupyter_contrib_nbextensions – a collection of notebook extensions. Install from GitHub .

jupyter dashboards – lets you turn notebooks into dashboards. Install from GitHub .

After installation, the extensions appear in the notebook UI (see screenshots).

With the dashboard extension you can arrange cells as draggable panels and export a clean report without code cells.

All set – you now have a polished Jupyter notebook environment ready for development and presentation.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PythonConfigurationJupyterExtensionsnotebookIPython
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.