As a dark mode lover, I find the default Matplotlib dark plot unsatisfactory. So this is a collection of good dark themes for Matplotlib that I found on GitHub, along with installation instructions and usage snippets.
Note: The line %config InlineBackend.figure_format = 'retina'
is optional but it makes your plots high resolution in Jupyter notebooks.
Source: https://github.com/quantumblacklabs/qbstyles
pip install qbstyles
import matplotlib.pyplot as plt
import seaborn as sns
%config InlineBackend.figure_format = 'retina'
from qbstyles import mpl_style
mpl_style(dark=True)
#Plot here
You can change dark=True
to dark=False
for a good light theme, but why would you ever do that?
Source: https://github.com/dhaitz/matplotlib-stylesheets
import matplotlib.pyplot as plt
import seaborn as sns
%config InlineBackend.figure_format = 'retina'
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-dark.mplstyle')
##Plot here
Source: https://github.com/dhaitz/mplcyberpunk
pip install mplcyberpunk
import matplotlib.pyplot as plt
import seaborn as sns
%config InlineBackend.figure_format = 'retina'
import mplcyberpunk
plt.style.use('cyberpunk')
#Plot here
mplcyberpunk.add_glow_effects()
Source: https://github.com/lewlin/material_darker_mpl
- Download
material_darker.mplstyle
from the linked repo into~/.matplotlib/stylelib/
(create folder if necessary). - Make sure that
~/.matplotlib/stylelib/
is listed in the output ofsys.path
(callable from iPython).
import matplotlib.pyplot as plt
import seaborn as sns
%config InlineBackend.figure_format = 'retina'
plt.style.use('material_darker')
#Plot here
import matplotlib.pyplot as plt
import seaborn as sns
%config InlineBackend.figure_format = 'retina'
plt.style.use('dark_background')
#Plot here