The term 'viridis' is derived from Latin, translating to 'green'. However, when we ask 'what colour is viridis?', it's not as straightforward as it seems. Viridis, in the context of color, is often associated with the color green, but it's also a term used in the field of color science and technology to describe a specific color space.

In color science, viridis is a perceptually uniform color map. This means that each step between two colors in the viridis map appears to be the same size, regardless of where it falls in the color spectrum. This is particularly useful in data visualization, ensuring that data points are evenly spaced and easily distinguishable.

Understanding the Viridis Color Space
The viridis color space was developed by Stéfan van der Walt and Nathaniel Smith in 2016. It's designed to be perceptually uniform, diverging, and have high contrast. These properties make it an excellent choice for visualizing data, especially when dealing with large datasets or complex visualizations.

One of the key features of the viridis color space is its use of the LAB color space as a basis. The LAB color space is a color-opponent space with dimensions for lightness (L), and the two color-opponent dimensions (a and b), which are based on non-linear transformations of RGB colors. This allows viridis to maintain high contrast and perceptual uniformity across a wide range of colors.
Perceptual Uniformity in Viridis

Perceptual uniformity is a crucial aspect of the viridis color space. It ensures that each step between two colors in the map appears to be the same size, regardless of where it falls in the color spectrum. This is achieved by using a non-linear mapping function that adjusts the spacing of colors based on human perception of color difference.
This property is particularly useful in data visualization, as it ensures that data points are evenly spaced and easily distinguishable. For instance, in a heatmap, each color represents a specific value, and with viridis, the difference between each color is perceived as equal, making it easier to interpret the data.
Diverging and High Contrast in Viridis

Viridis is also designed to be a diverging color map. This means that it has a center point, and colors on either side of the center are mirror images of each other. This property is useful when visualizing data with a clear midpoint, such as temperature data, where values on either side of the midpoint (e.g., 0°C) are symmetrical.
The high contrast of the viridis color space is another key feature. This is achieved by using a wide range of colors and ensuring that adjacent colors have a significant difference in hue. This makes it easier to distinguish between different data points, even when they are close together.
Viridis in Data Visualization

Viridis is widely used in data visualization, particularly in scientific and technical fields. Its perceptually uniform, diverging, and high-contrast properties make it an excellent choice for visualizing complex datasets.
One of the key benefits of using viridis in data visualization is that it allows for more accurate interpretation of data. Because each color represents an equal step in value, it's easier to compare and contrast different data points. This can be particularly useful in fields like climate science, where small changes in temperature can have significant impacts.


















Viridis in Seaborn Library
Viridis is a built-in color palette in Seaborn, a popular Python data visualization library. Seaborn's implementation of viridis includes a range of 22 colors, from dark green to bright yellow, with a center point at a light green color.
To use viridis in Seaborn, you can simply pass 'viridis' as the 'palette' parameter to the relevant function, such as 'sns.scatterplot()' or 'sns.heatmap()'. For example, 'sns.scatterplot(x='x', y='y', hue='z', palette='viridis', data=df)' will create a scatter plot with a viridis color palette based on the values in the 'z' column of the DataFrame 'df'.
Viridis in Matplotlib
Viridis is also available in Matplotlib, another popular Python data visualization library. In Matplotlib, viridis is available as a built-in colormap, which can be used in functions like 'scatter()', 'imshow()', or 'pcolormesh()'.
To use viridis in Matplotlib, you can simply pass 'viridis' as the 'cmap' parameter to the relevant function. For example, 'plt.scatter(x, y, c=z, cmap='viridis')' will create a scatter plot with a viridis colormap based on the values in the 'z' array.
In conclusion, while the term 'viridis' is derived from Latin and often associated with the color green, in the world of data visualization, it's much more than that. It's a perceptually uniform, diverging, and high-contrast color space that's revolutionizing how we interpret and understand data. Whether you're a data scientist, a researcher, or a designer, understanding viridis can help you create more accurate, more informative, and more beautiful visualizations.