Skip to main content
Albero Academy

Styles & rcParams

Restyle every chart at once with stylesheets and global settings.

Styling & Themes8 min

Rather than styling each chart by hand, you can set a global style that applies to everything. Stylesheets give a consistent look in one line; rcParams tweaks individual defaults.

Built-in stylesheets

one line, whole new look
plt.style.use("seaborn-v0_8-whitegrid") # clean, gridded
plt.style.use("ggplot") # R's ggplot look
plt.style.use("fivethirtyeight") # bold, editorial
print(plt.style.available) # list them all

rcParams

tweak global defaults
plt.rcParams["figure.figsize"] = (10, 6)
plt.rcParams["font.size"] = 12
plt.rcParams["axes.spines.top"] = False
plt.rcParams["axes.spines.right"] = False

Key takeaways

  1. 01plt.style.use(name) restyles all charts at once (ggplot, fivethirtyeight, seaborn…).
  2. 02plt.style.available lists the built-in stylesheets.
  3. 03rcParams override individual global defaults (figsize, fonts, spines).
  4. 04Set them once at the top for consistency; use style.context for a scoped block.

Finished this chapter?

Mark it complete to track your progress through Matplotlib.