Skip to content
Python for Data Science

Seaborn Color Palettes: A Practical Guide for Data Science in Python

Choosing the wrong color palette can quietly wreck a good chart. I learned this the hard way early in my career, presenting a churn-rate heatmap in a rainbow palette to a room of stakeholders who spent the first five minutes arguing about which colors meant “bad” instead of listening to what the data said. Seaborn’s built-in color palettes fix this by giving you three purpose-built families — sequential, diverging, and qualitative — each matched to a specific type of data, so your audience reads the message instead of decoding the legend.

In this guide I’ll walk through every palette family Seaborn ships with, show you the exact code I use to pick one, and flag the mistakes I still see in production dashboards.

What Are Seaborn Color Palettes?

A Seaborn color palette is a predefined list of colors, accessed through sns.color_palette(), designed to map cleanly onto the structure of your data. Seaborn builds on matplotlib’s colormap system but adds perceptually-informed defaults and a consistent API, which is why most of my visualization work starts in Seaborn even when the final chart gets polished in raw matplotlib.

import seaborn as sns
import matplotlib.pyplot as plt

palette = sns.color_palette("viridis")
sns.palplot(palette)
plt.show()

Run that in a notebook and you get a strip of swatches — the fastest way I know to sanity-check a palette before committing to it.

Sequential Palettes: For Ordered, Continuous Data

Sequential palettes move from light to dark along a single hue. Use them whenever your values have a natural low-to-high order — revenue, temperature, error rate, model confidence.

  • Single-hue: Blues, Greens, Greys, Oranges, Purples, Reds
  • Multi-hue: BuGn, BuPu, GnBu, OrRd, PuBu, PuBuGn, PuRd, YlGn, YlGnBu, YlOrBr
  • Perceptually uniform: viridis, plasma, inferno, magma, cividis, rocket, mako, flare, crest

I default to viridis or Seaborn’s own rocket/mako for anything that might get printed in grayscale or viewed by a colorblind stakeholder — they’re built to remain readable when hue information is lost, which single-hue Brewer palettes like Blues are not as reliable at.

sns.heatmap(corr_matrix, cmap="rocket", annot=True, fmt=".2f")

Diverging Palettes: For Data With a Meaningful Midpoint

Diverging palettes use two hues radiating from a neutral center. They’re the right choice when zero (or some other reference value) actually means something — correlation coefficients, profit vs. loss, temperature anomaly.

sns.heatmap(correlation_df, cmap="RdBu_r", center=0, annot=True)

Notice the _r suffix — every Seaborn palette can be reversed by appending _r, and it’s the single most useful modifier in the whole system. I use it constantly because the “intuitive” direction of red-means-bad vs. red-means-good changes depending on the audience and the metric.

Common diverging options: BrBG, PRGn, PiYG, PuOr, RdBu, RdGy, RdYlBu, RdYlGn, coolwarm, seismic, icefire, vlag.

Qualitative Palettes: For Categories With No Order

When you’re distinguishing product lines, regions, or experiment arms — groups that don’t rank against each other — reach for a qualitative palette: Set1, Set2, Set3, Paired, Pastel1, Pastel2, Accent, Dark2.

sns.scatterplot(data=df, x="tenure", y="usage", hue="plan_type", palette="Set2")

A mistake I still see junior analysts make: using a sequential palette like Blues for categorical hue mapping. It technically renders, but it implies an ordering that doesn’t exist — readers will unconsciously assume the darkest category is “more” of something.

Adjusting Lightness With the _d Suffix

Appending _d to a palette name (e.g. Blues_d, Greens_d) darkens it — handy when you need higher contrast against a light background without switching hue families entirely.

sns.barplot(data=df, x="category", y="value", palette="Blues_d")

A Quick Decision Framework

Your data Palette family Example
Ordered, continuous, one direction Sequential viridis, YlGnBu
Ordered, with a meaningful zero/center Diverging RdBu_r, coolwarm
Unordered categories Qualitative Set2, Dark2

This is the exact table I sketch on a whiteboard when I onboard new analysts — it resolves 90% of “which palette should I use” questions in about ten seconds.

Frequently Asked Questions

What is the default Seaborn color palette?

Seaborn’s default is called deep, a qualitative palette of ten muted colors. It’s applied automatically unless you call sns.set_palette() or pass a palette argument explicitly.

How do I make a Seaborn palette colorblind-friendly?

Use sns.color_palette("colorblind"), a qualitative palette specifically designed to remain distinguishable under the most common forms of color vision deficiency. For continuous data, pair it with viridis-family sequential palettes.

Can I create a custom Seaborn palette?

Yes — use sns.color_palette(["#3366cc", "#dc3912", "#ff9900"]) to pass hex codes directly, or sns.light_palette("seagreen") to generate a sequential ramp from a single seed color.

Related Reading

If you’re building geographic visualizations, our guide to choropleth mapping in Python covers how these same palette families apply to map classification. For the plotting fundamentals underneath all of this, see our introduction to Python plotting for data science.

Elizabeth Sramek is a data scientist at Automatic Statistician, where she works on automated statistical modeling, data visualization, and applied machine learning workflows.


Elizabeth Sramek
Written by
Elizabeth Sramek

Elizabeth Sramek is an independent advisor on search visibility and demand architecture for B2B companies operating in high-competition markets. Based in Prague and working globally, she specializes in designing search presence for AI-mediated discovery and building category visibility that survives algorithmic shifts.

Leave a response