<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Python,色 on Visualizing.JP</title>
        <link>https://visualizing.jp/en/tags/python%E8%89%B2/</link>
        <description>Recent content in Python,色 on Visualizing.JP</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-US</language>
        <copyright>Yuichi Yazaki</copyright>
        <lastBuildDate>Tue, 11 Nov 2025 00:00:00 +0900</lastBuildDate><atom:link href="https://visualizing.jp/en/tags/python%E8%89%B2/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>How Matplotlib Moved from jet to Viridis</title>
        <link>https://visualizing.jp/en/matplotlib-colorscheme/</link>
        <pubDate>Tue, 11 Nov 2025 00:00:00 +0900</pubDate>
        
        <guid>https://visualizing.jp/en/matplotlib-colorscheme/</guid>
        <description>&lt;img src="https://visualizing.jp/matplotlib-colorscheme/images/option_d.png" alt="Featured image of post How Matplotlib Moved from jet to Viridis" /&gt;&lt;p&gt;For many years, Matplotlib&amp;rsquo;s default colormap was &lt;code&gt;jet&lt;/code&gt;. Its perceptual unevenness and poor support for color-vision diversity were increasingly criticized, and the Matplotlib community eventually introduced a new set of perceptually uniform colormaps centered on Viridis. This article traces that change through primary sources and related discussions.&lt;/p&gt;
&lt;h2 id=&#34;the-matlab-legacy-of-jet&#34;&gt;The MATLAB Legacy of jet
&lt;/h2&gt;&lt;p&gt;Matplotlib was originally designed to feel familiar to researchers and engineers moving from MATLAB to Python. MATLAB had long used rainbow-like colormaps, especially &lt;code&gt;jet&lt;/code&gt;, and Matplotlib followed that convention.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://visualizing.jp/matplotlib-colorscheme/images/jet.png&#34;
	width=&#34;2000&#34;
	height=&#34;1200&#34;
	srcset=&#34;https://visualizing.jp/matplotlib-colorscheme/images/jet_hu_d34c7935960e814e.png 480w, https://visualizing.jp/matplotlib-colorscheme/images/jet_hu_7ad0e885d64cf41b.png 1024w&#34;
	loading=&#34;lazy&#34;
	
		alt=&#34;jet&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;166&#34;
		data-flex-basis=&#34;400px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;The problem is that rainbow colormaps have serious perceptual weaknesses. Their brightness changes are not uniform, so flat data can appear to contain false edges. Yellow and green regions can attract attention even when they do not correspond to meaningful extremes. They also degrade poorly in grayscale and for many color-vision-diverse readers.&lt;/p&gt;
&lt;p&gt;Visualization researchers had criticized these problems for years. Matplotlib&amp;rsquo;s own documentation now notes that rainbow colormaps are generally poor choices for quantitative scalar data.&lt;/p&gt;
&lt;h2 id=&#34;the-turning-point-issue-875&#34;&gt;The Turning Point: Issue #875
&lt;/h2&gt;&lt;p&gt;In 2012, the Matplotlib GitHub issue &amp;ldquo;Replace &amp;lsquo;jet&amp;rsquo; as the default colormap&amp;rdquo; made the problem explicit. The discussion argued that rainbow colormaps can confuse viewers, obscure data through uncontrolled luminance variation, and introduce gradients that are not present in the data.&lt;/p&gt;
&lt;p&gt;This issue gave the community a concrete design question: if &lt;code&gt;jet&lt;/code&gt; should no longer be the default, what should replace it?&lt;/p&gt;
&lt;h2 id=&#34;designing-the-new-colormaps&#34;&gt;Designing the New Colormaps
&lt;/h2&gt;&lt;p&gt;In 2015, Nathaniel J. Smith and Stéfan van der Walt designed four candidate colormaps: Magma, Inferno, Plasma, and Viridis.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://visualizing.jp/matplotlib-colorscheme/images/option_a.png&#34;
	width=&#34;2000&#34;
	height=&#34;1200&#34;
	srcset=&#34;https://visualizing.jp/matplotlib-colorscheme/images/option_a_hu_889c0d1a97ec30f7.png 480w, https://visualizing.jp/matplotlib-colorscheme/images/option_a_hu_36d81c99e2c7a171.png 1024w&#34;
	loading=&#34;lazy&#34;
	
		alt=&#34;Option A&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;166&#34;
		data-flex-basis=&#34;400px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://visualizing.jp/matplotlib-colorscheme/images/option_b.png&#34;
	width=&#34;2000&#34;
	height=&#34;1200&#34;
	srcset=&#34;https://visualizing.jp/matplotlib-colorscheme/images/option_b_hu_4d1bf74eb2d9870a.png 480w, https://visualizing.jp/matplotlib-colorscheme/images/option_b_hu_4346f762472c7ba0.png 1024w&#34;
	loading=&#34;lazy&#34;
	
		alt=&#34;Option B&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;166&#34;
		data-flex-basis=&#34;400px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://visualizing.jp/matplotlib-colorscheme/images/option_c.png&#34;
	width=&#34;2000&#34;
	height=&#34;1200&#34;
	srcset=&#34;https://visualizing.jp/matplotlib-colorscheme/images/option_c_hu_5ffb980507a92e0d.png 480w, https://visualizing.jp/matplotlib-colorscheme/images/option_c_hu_640cd0cbfd43cf14.png 1024w&#34;
	loading=&#34;lazy&#34;
	
		alt=&#34;Option C&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;166&#34;
		data-flex-basis=&#34;400px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://visualizing.jp/matplotlib-colorscheme/images/option_d.png&#34;
	width=&#34;2000&#34;
	height=&#34;1200&#34;
	srcset=&#34;https://visualizing.jp/matplotlib-colorscheme/images/option_d_hu_612e67532ae7d4b1.png 480w, https://visualizing.jp/matplotlib-colorscheme/images/option_d_hu_8f0732574f9d2922.png 1024w&#34;
	loading=&#34;lazy&#34;
	
		alt=&#34;Option D&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;166&#34;
		data-flex-basis=&#34;400px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;The candidates were designed around several principles: perceptual uniformity, monotonically increasing luminance, readability in grayscale, and better behavior for color-vision diversity. &amp;ldquo;Option D&amp;rdquo; became Viridis and was selected as the new default for Matplotlib 2.0.&lt;/p&gt;
&lt;h2 id=&#34;why-viridis-works-better&#34;&gt;Why Viridis Works Better
&lt;/h2&gt;&lt;p&gt;Viridis is a sequential colormap with a controlled progression of lightness. This means equal steps in data are more likely to look like equal perceptual steps. It remains interpretable in grayscale and avoids the false boundaries that rainbow maps often create.&lt;/p&gt;
&lt;p&gt;The change was not merely aesthetic. It was a shift from tradition-driven defaults to perception-driven design.&lt;/p&gt;
&lt;h2 id=&#34;design-lessons&#34;&gt;Design Lessons
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Default choices matter because many users never change them.&lt;/li&gt;
&lt;li&gt;Sequential quantitative data should use perceptually ordered colormaps.&lt;/li&gt;
&lt;li&gt;Luminance is as important as hue.&lt;/li&gt;
&lt;li&gt;Accessibility should be part of the default, not an optional refinement.&lt;/li&gt;
&lt;li&gt;Scientific visualization should avoid color schemes that create non-data artifacts.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary
&lt;/h2&gt;&lt;p&gt;Matplotlib&amp;rsquo;s move from &lt;code&gt;jet&lt;/code&gt; to Viridis is one of the clearest examples of visualization practice absorbing findings from perception research. The new default made ordinary plots more accurate, accessible, and less misleading without requiring users to become color experts.&lt;/p&gt;</description>
        </item>
        
    </channel>
</rss>
