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
plt.style.use("seaborn-v0_8-whitegrid") # clean, griddedplt.style.use("ggplot") # R's ggplot lookplt.style.use("fivethirtyeight") # bold, editorialprint(plt.style.available) # list them all
rcParams
plt.rcParams["figure.figsize"] = (10, 6)plt.rcParams["font.size"] = 12plt.rcParams["axes.spines.top"] = Falseplt.rcParams["axes.spines.right"] = False
Key takeaways
- 01plt.style.use(name) restyles all charts at once (ggplot, fivethirtyeight, seaborn…).
- 02plt.style.available lists the built-in stylesheets.
- 03rcParams override individual global defaults (figsize, fonts, spines).
- 04Set them once at the top for consistency; use style.context for a scoped block.
