Skip to main content
v2026.11,858 entries · CC-BY 4.0

Seaborn Color Palettes: Choose, Set and Report Them

Seaborn color palettes: a table that matches data type to palette class, the exact commands, fixes for repeated colors, and how to report the palette.

Written and maintained by CASRAI Editorial Board

Last updated

A seaborn color palette is a list of colors, or a continuous colormap, that seaborn applies to the groups or values in a figure. The seaborn documentation sorts palettes into three classes, qualitative, sequential and diverging, and the class you pick should follow the type of data you plot. This guide gives a decision table for that choice, the exact commands from the current seaborn documentation, the traps that make colors repeat or disappear, and a way to record the palette so a figure can be regenerated from your methods section.

Which palette for which data

Choose the palette class from the data, then choose a named palette inside that class. The names below are the ones the seaborn color palette tutorial uses.

Your data Palette class Named palettes in the seaborn docs
Unordered groups (treatment arms, sites, species) Qualitative: variation mainly in hue deep (default), muted, pastel, bright, dark, colorblind; Color Brewer Set2 and Paired
Ordered or numeric values (concentration, dose, count) Sequential: luminance is the main variation rocket and mako (wide luminance range, suited to heatmaps); flare and crest (narrower luminance range, more hue variation, suited to lines and points); matplotlib magma and viridis
Numeric values with a meaningful midpoint (change from baseline, correlation) Diverging: two dominant hues at the poles vlag and icefire (blue and red poles); matplotlib coolwarm; Color Brewer Spectral

The seaborn tutorial states the default is “a qualitative palette with ten distinct hues” that follows the ordering of matplotlib’s tab10 but is less intense. Calling sns.color_palette() with no arguments returns whatever palette is currently the default.

What it is used for in research

In a research figure the palette carries meaning: it tells the reader which points belong to the same group or how large a value is. Seaborn builds on matplotlib, so the same palettes work for scatter plots, box plots, histograms and heatmaps. Related CASRAI guides cover the plot types themselves, including scatter plots in Python and the histogram, and the figure-level rules in designing effective scientific figures and scientific figure rules for journal submission.

Install or access

The seaborn installation page lists these commands:

pip install seaborn
pip install seaborn[stats]
conda install seaborn
conda install seaborn -c conda-forge

The installation page notes that the conda-forge channel may carry newer releases. Seaborn requires numpy, pandas and matplotlib, and the page lists “Python 3.8+” under supported Python versions (check the page for the current wording).

Step by step: choose, set and apply a palette

  1. Look at the current default. Run sns.color_palette(). With no arguments it returns the current default palette as a list of RGB tuples.
  2. Request a named palette. Pass a name and, optionally, a number of colors: sns.color_palette("tab10"), sns.color_palette("Set2"), sns.color_palette("Paired"), sns.color_palette("hls", 8) or sns.color_palette("husl", 8). The full signature is seaborn.color_palette(palette=None, n_colors=None, desat=None, as_cmap=False).
  3. Request a continuous colormap for numeric data. Add as_cmap=True: sns.color_palette("rocket", as_cmap=True). Append _r to reverse any continuous colormap, for example "rocket_r".
  4. Build a palette from one color. The string forms "light:b" and "dark:salmon_r" make a sequential palette from a single color; sns.light_palette("seagreen", as_cmap=True) and sns.dark_palette("#69d", reverse=True, as_cmap=True) do the same through functions. "ch:start=.2,rot=-.3" or sns.cubehelix_palette(start=.5, rot=-.5, as_cmap=True) builds a cubehelix palette.
  5. Build a diverging palette. sns.diverging_palette(220, 20, as_cmap=True) gives a blue-to-red scale; sns.diverging_palette(250, 30, l=65, center="dark", as_cmap=True) sets a dark center.
  6. Make it the default for every later plot. sns.set_palette() changes the default. Its signature is seaborn.set_palette(palette, n_colors=None, desat=None, color_codes=False); it sets the matplotlib color cycle using a seaborn palette and accepts the same arguments as color_palette(). With color_codes=True the matplotlib shorthand “b”, “g” and “r” is remapped to colors in the palette.

For a single plot, pass the palette to the plotting function’s palette argument alongside a hue variable;.

Output and how to read it

Without as_cmap=True, color_palette() returns a list of RGB tuples, one per color. With as_cmap=True it returns a matplotlib ListedColormap, which is what you hand to a heatmap or any plot that maps numbers to color.

Read the palette by class. In a qualitative palette, colors differ in hue and carry no order, so no group should look “higher” than another. In a sequential palette, darker or lighter means more or less, so the direction matters; reverse it with _r if the lighter end should mean larger. In a diverging palette, the middle color stands for the midpoint, so center it on a value that means something in your data.

Troubleshooting

Two groups share a color

Named palettes default to 6 colors, and asking for more colors than the palette holds cycles back to the start. If you have 8 groups, request them explicitly: sns.color_palette("hls", 8) or sns.color_palette("husl", 8), the forms the documentation shows with 8 colors.

The palette did not change the existing plots

color_palette() returns colors; it does not change the default. Use set_palette() to change the default for later plots, or pass the result to the palette argument of the plot you are drawing.

The extreme colors are missing from a discrete palette

The documentation notes that discrete versions of sequential colormaps omit the most extreme values. Use as_cmap=True when you want the full continuous range for numeric data.

n_colors seems to be ignored

The function reference states that n_colors is ignored when as_cmap=True, because a continuous colormap has no fixed number of colors.

Report the palette so the figure can be regenerated

A figure is easier to reproduce when the code names the palette and the number of colors instead of relying on the default. Write sns.set_palette("colorblind", n_colors=6) or sns.color_palette("rocket", as_cmap=True) in the script, and keep the string for custom palettes ("light:seagreen", "blend:#7AB,#EDA", "ch:start=.2,rot=-.3"), because the documented string forms light:, dark:, blend: and ch: let a reader rebuild the palette exactly. In the methods section or figure legend, state the seaborn palette name and, if you set it, the number of colors. Journal-specific requirements for figures are covered in the guide on scientific figure rules for journal submission.

Free alternatives

Option What it offers Where it appears in the seaborn docs or on CASRAI
matplotlib colormaps magma, viridis and coolwarm, usable directly in seaborn by name Named in the seaborn color palette tutorial; any matplotlib colormap name is a valid palette string
Color Brewer palettes Set2, Paired, Blues, YlOrBr, Spectral Named in the seaborn color palette tutorial
ggplot2 colors (R) The R route to the same task See the CASRAI guide ggplot color

FAQ

What are seaborn color palettes?

Seaborn color palettes are the lists and continuous colormaps that color_palette() returns and that seaborn plots use to color groups or values. The tutorial groups them as qualitative, sequential and diverging.

What is the default seaborn color palette?

The default is a qualitative palette with ten distinct hues that follows the ordering of matplotlib’s tab10 but is less intense. The variants deep, muted, pastel, bright, dark and colorblind adjust it.

How do I change seaborn colors for every plot?

Call sns.set_palette() once with a palette name or list. It sets the matplotlib color cycle from the seaborn palette and accepts the same arguments as color_palette().

How do I pick a seaborn color for one series?

Take a single entry from the list that color_palette() returns; each entry is an RGB tuple. To use a palette only temporarily, the function reference says color_palette() can also be used in a with statement to set the color cycle for a plot or set of plots.

Sources

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Seaborn Color Palettes: Choose, Set and Report Them

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →

Ask CASRAI · Regulatory Radar

Research-admin question? Get an answer that links its sources.

An AI assistant specialized in research administration. Every answer links its sources to check before you act. 2 questions free, no account. $29/month after.

  • Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.
  • Every answer numbers its sources and links each one, so you can check the source yourself.