how we designed matplotlib s new default colormap and you can too net worth
Decoding Visual Perception: How Matplotlib Designed Its New Default Colormap (And How You Can Too)
Key Takeaways
- Perceptual Uniformity: The transition from 'jet' to 'viridis' solved critical accessibility and data distortion issues by ensuring equal steps in data correspond to equal steps in perceived color.
- Monotonic Luminance: A strictly increasing luminance curve prevents false visual boundaries and ensures seamless readability for color-vision-deficient users.
- Application Beyond Python: The mathematical and psychological principles used by Stéfan van der Walt and Nathaniel Smith can be applied to brand palettes, UI/UX design, and data visualization tools universally.
- Busting the "Net Worth" Myth: Searches querying the monetary value ("net worth") of open-source design breakthroughs highlight the immense commercial and scientific value of robust UI/UX architecture.
When the Python data visualization library Matplotlib replaced its iconic, yet deeply flawed, default colormap Jet with Viridis in 2015, it was more than an aesthetic update. It was a masterclass in applied psychophysics, human-computer interaction, and open-source collaboration. Spearheaded by software engineers Stéfan van der Walt and Nathaniel Smith, the redesign project revolutionized how scientists, analysts, and engineers interpret multidimensional data.
While internet search queries occasionally conflate technical breakthroughs with speculative metrics—often searching for terms like "matplotlib design net worth"—the true value of this design lies in its foundational impact on scientific accuracy, decision-making, and accessibility. In this deep-dive analysis, we explore the exact methodology behind the creation of Matplotlib's perceptually uniform colormaps and provide a blueprint for how you can engineer your own.
The Anatomy of a Flawed Standard: Why Jet Had to Go
For over a decade, Jet served as the default colormap for MATLAB and early versions of Matplotlib. Visually striking with its vibrant blues, cyans, yellows, and reds, Jet possessed catastrophic perceptual flaws that fundamentally distorted underlying datasets.
The human eye does not perceive all colors equally. We are disproportionately sensitive to green, while relatively insensitive to blue and red. In Jet, luminance (perceived brightness) fluctuates wildly, peaking aggressively in the yellow-green middle and dropping off at both extremes. This non-monotonic luminance curve creates artificial visual "bends" or sharp boundaries where none exist in the data, essentially tricking the human brain into seeing patterns that are purely artifacts of the color scale.
The Blueprint: How to Design a Perceptually Uniform Colormap
To fix these issues, Van der Walt and Smith utilized Python's CIELAB and CIELCh color spaces—mathematical models designed to approximate human color perception. Designing a robust colormap requires adherence to three rigid engineering constraints:
1. Strictly Monotonically Increasing Luminance
As you move from the lowest value of your dataset to the highest, the perceived lightness ($L^*$ in CIELAB) must move in one direction only—either strictly upward or strictly downward. This guarantees that dark colors represent low values and bright colors represent high values intuitively, without creating false perceptual contours.
2. Smooth Hue Transitions
Shifting abruptly across disparate color families introduces perceptual cliffs. Effective colormaps transition smoothly across carefully curated hues (e.g., from deep purple through teal to bright yellow) while letting the luminance carry the primary informational weight.
3. Color-Blind Friendliness
Roughly 8% of men and 0.5% of women experience some form of color vision deficiency (CVD), predominantly red-green color blindness. A properly engineered colormap must remain readable and informative when desaturated or viewed through various CVD filters.
Data Comparison: Legacy Colormaps vs. Modern Perceptual Standards
To understand the quantitative and qualitative leap made by the Matplotlib team, examine the comparative metrics below:
| Colormap Metric | Jet (Legacy Default) | Viridis (Modern Default) |
|---|---|---|
| Luminance Profile | Non-monotonic (peaks in the middle) | Strictly monotonic (smooth linear climb) |
| Perceptual Uniformity | Low (unequal visual steps for equal data steps) | High (uniform visual steps across the spectrum) |
| Colorblind Accessibility | Poor (hides critical data for red-green deficient users) | Excellent (fully distinguishable across major CVD types) |
| Grayscale Printability | Terrible (collapses into muddy, unreadable mid-tones) | High (maintains clear gradient hierarchy in monochrome) |
| Primary Use Case | Aesthetically dramatic, historically entrenched | Rigorous scientific plotting, data integrity |
How You Can Design Your Own Custom Colormap
Whether you are building a proprietary data visualization library, designing a specialized dashboard, or crafting a brand identity, you can replicate the Matplotlib engineering process using open-source tools.
Step-by-Step Implementation Guide
- Define the Data Range and Intent: Determine whether your scale is sequential (one-directional), diverging (centered around a critical midpoint like zero), or qualitative (categorical).
- Leverage Perceptual Color Spaces: Avoid RGB or HEX when designing gradients. Instead, use CIELAB or CIELCh color spaces via Python libraries like
colormapsorviscm(Visual Colormap Construction). - Plot the Luminance Curve: Generate a cross-section of your colormap's lightness ($L^*$). Ensure the curve rises steadily without local maxima or minima.
- Test Against CVD Filters: Run your newly generated palette through simulation tools (such as Coblis or Python's
matplotlib.colorsutilities) to ensure deuteranopia, protanopia, and tritanopia compliance.
Frequently Asked Questions
1. Why did Matplotlib change its default colormap from Jet to Viridis?
Jet was replaced because its non-monotonic luminance profile distorted data representation, created optical illusions of false boundaries, and failed accessibility standards for users with color vision deficiencies. Viridis provides true perceptual uniformity, ensuring data accuracy.
2. What is the financial "net worth" or value of the Matplotlib colormap redesign?
While open-source tools like Matplotlib are freely distributed, the commercial value of preventing data misinterpretation in fields like medical imaging, climate science, and financial modeling is immeasurable. The intellectual capital behind standardizing perceptual tools saves millions of engineering and research hours annually.
3. Can I use the Viridis colormap outside of Python?
Yes. Due to its overwhelming success, the Viridis palette (along with its sibling maps Inferno, Plasma, and Magma) has been ported to R, MATLAB, JavaScript (D3.js), Tableau, and CSS libraries, making it a universal standard for modern data visualization.