ColorBrewer hex codes for Set2, Dark2, Paired, Blues, RdBu, and RdYlBu, with guidance on picking sequential, diverging, or qualitative for research data.
SciFig Team
SciFig editorial team
ColorBrewer provides tested sequential, diverging, and qualitative palettes.
It began as a cartography tool from Cynthia Brewer and Mark Harrower at Penn State, and it remains the most widely used palette library in scientific plotting because it does one thing well: it separates palettes by the kind of data they encode, then tells you which ones survive colorblindness and grayscale printing.
Three rows of ColorBrewer swatches labeled sequential, diverging, and qualitative, each with hex codes beneath (ColorBrewer swatch chart rendered by SciFig)
Pick the Palette Type First
Almost every bad color choice in a scientific figure is a type error rather than a taste error. Match the palette family to the data before comparing individual colors.
Data type
Palette family
Example
Use for
Unordered categories
Qualitative
Set2, Dark2, Paired
Species, treatment groups, conditions
Ordered / continuous
Sequential
Blues, Greens, YlOrRd
Concentration, count, density
Diverging from a midpoint
Diverging
RdBu, RdYlBu, BrBG
Log fold change, anomaly, correlation
Using a diverging palette for sequential data invents a midpoint that is not there. Using a sequential palette for categories implies a ranking that does not exist. Both mislead readers before they read a single axis label.
See Figure Enhancement in Action
Upscale, recolor, or relabel any existing scientific figure to 8K journal-ready quality.
Paired (12 classes) — colors come in light/dark pairs, which is useful when categories nest naturally, such as control and treated within each genotype.
A caution on Paired: only the pairing is meaningful. Do not use it for twelve unrelated categories, because readers will infer relationships from the pairing that your data does not support.
RdYlBu (5 classes) — diverging with a yellow center, higher contrast at the extremes.
#D7191C#FDAE61#FFFFBF#ABD9E9#2C7BB6
For diverging maps, anchor the neutral color to the meaningful midpoint. If your log fold change runs from -1 to +4 and you let the software center the scale on the data range, the neutral color lands at +1.5 and the figure will read as though most genes are downregulated.
A diverging heatmap shown twice, once centered on the data range and once centered correctly on zero, producing opposite visual impressions (Comparison figure generated with SciFig)
Three example charts using a sequential, a diverging, and a qualitative ColorBrewer palette on matching data (Figure generated with SciFig)
Colorblind-Safe Subset
Not every ColorBrewer palette is colorblind safe, and the qualitative family is the weakest. As a practical rule:
Sequential single-hue palettes (Blues, Greens, Purples) are safe by construction, since they vary mainly in lightness.
Set2 and Dark2 hold up well at three to four classes and degrade beyond that.
Paired is not reliable, because the light/dark pairing that carries meaning compresses under deficiency.
If you need more than four qualitative categories and accessibility matters, the Okabe-Ito palette is a better starting point than any ColorBrewer qualitative set. Our guide to color palettes for scientific figures covers that trade-off in detail.
Tip
ColorBrewer palettes are capped deliberately. If a scheme offers at most 8 or 9 classes, that is a finding, not a limitation — beyond that count readers stop matching colors to a legend reliably. Treat the cap as a signal to restructure the figure.
A grouped bar chart using Set2 with direct labels, next to the same chart with a twelve-item legend showing why the legend version is harder to read (Figure generated with SciFig)
Create Scientific Figures Now
Describe your scientific figure in natural language — get publication-ready illustrations in minutes.
SciFig's scientific color palette generator applies these family rules while you build a figure, and figure enhancer recolors an existing one without rebuilding it. For data plots, SciFig DataChart (data-driven charts) generates the chart precisely from your data with built-in discrete palettes and continuous colormaps, and every color stays editable.
Set2 with 8 classes is #66C2A5, #FC8D62, #8DA0CB, #E78AC3, #A6D854, #FFD92F, #E5C494, and #B3B3B3. It is a soft qualitative palette suited to grouped bars and boxplots with a small number of categories.
Yes. ColorBrewer's color specifications are made available under an Apache-style license that permits use in publications and software. Check the current license text on the ColorBrewer site if your publisher requires an explicit statement.
Use a sequential palette such as Blues or YlOrRd when values run from low to high, and a diverging palette such as RdBu when values diverge around a meaningful midpoint like zero. Center diverging maps on that midpoint, not on the data range.
No. Sequential single-hue palettes are safe by construction, Set2 and Dark2 hold up to about four classes, and Paired is unreliable because its light/dark pairing compresses under color vision deficiency.
They share a structure but differ in saturation. Set2 is muted and works well for large filled areas such as bars, while Dark2 is more saturated and separates better for thin lines and small markers.
Because reliable color matching breaks down beyond roughly eight categories. The cap is a deliberate design decision reflecting perceptual limits, so treat it as a prompt to facet or directly label rather than to find a larger palette.
Keep going
Recommended resources
Templates, tools, and further reading for your research