# How to Analyze Data: 6 Useful Ways To Use Color In Graphs

## See Plotly’s Blog for Interactive Versions of the Plots Below

Aug 20, 2015 · 5 min read

Effectively using color means your graphs clearly communicate your data. This post shows how. We summarize and apply visualization research to real-world examples. You can make graphs like these with Plotly’s web app, or APIs for Python, MATLAB, andR.

For users who want to securely share graphs and data within a team, or make interactive dashboards, contact us about Plotly on-premise. In other Plotly news:

# 1. Consider Hue, Value & Saturation

Hue refers to the color’s name (green, red), value is the perceived lightness of the color (dark green, light green), and saturation describes its colorfulness relative to its own brightness. High saturation colors look vivid, while low saturation colors look grayish and muted.

The chart below shows sequential, diverging, and categorial scales. Each is an option to display data about the depth of a lake. The top right option gives us an informative chart and perspective on our sequential data. The darker colors in the middle clearly show where the water is deepest.

# 2. Use Semantic Color Associations

Love is red, nature is green. These semantic color associations pair concepts and colors. To test our associations, the Harvard Business Review used these two graphs and asked which would quickly allow you to tell whether blueberries or bananas sold more. Using semantic color associations–literally making the bars the color of each fruit–decreased the time it took to analyze the chart.

Here they are made in Plotly. Making the plot interactive so you can see data when you hover and labeling the bars makes interpretation even faster.

Color associations can vary by culture. Depending on your audience, colors might suggest concepts, making your graph easier or harder to read.

# 3. One Hue for Continuous Data

But colors don’t intuitively represent values. Does blue represent a larger number than green? Is orange “more” than purple? For example, the map below represents GDP per capita by country using a rainbow color sequence. If I asked whether New Zealand or Australia has a higher GDP per capita, you’d most likely have to check both colors on the legend to know.

Instead, we can represent continuous data and ranges by varying the saturation or value of a color. To do this in Plotly, you can use our color scales, RGB colors like (134,190,229), and hexadecimal color codes like #e6842a. A darker blue in this value scale represents a larger number than a lighter blue.

We can also blend scales. This plot shows net energy imports and exports as a percentage of energy. One hue shows positive values and one represents negative values. You can only use 100% of your energy, but you can export way more than you use.

# 4. Save High Saturation for the Most Important Data

Contrast draws attention, so having too much contrast will cause clutter. Instead, consider using muted colors as a general rule. Use high contrast colors only for important data. The first graph below doesn’t highlight anything, but muting every color except red allows us to highlight the declining viewership of the Simpsons in the second graph.

# 5. Use Color Psychology

Colors have a psychological effect. Green is a calming color representing possibility and stability. Red is an exciting color that conveys passion and power. Using color psychology can reinforce your ideas. Visual.ly’s infographic shows more.

PayPal and LinkedIn use blue for trustworthiness. CNN, ESPN and RedBull use a powerful red. British Petroleum has been trying to brand itself as an eco-friendly organization. Hence the use of green.

# 6. Keep It Legible

The higher the luminance contrast between two colors, the more legible it will be. Two different overlapping colors with the same saturation will be hard to distinguish. The green text below has a high saturation and hue contrast with the background, but the portions where the values are similar are still hard to read.

The plot below, made with Plotly’s Python API shows how you can use a gray background to emphasize the green scale for curvature in this Enneper surface.

Using color as a tool can either greatly improve or completely ruin your graph. Follow these guidelines and you’ll be able to optimize the colors in your graph to make your data stand out. If you have sensitive data, need to collaborate with your team, and need interactive dashboards, contact us about Plotly on-premise. If you liked what you read, please consider sharing. Find us at feedback@plot.ly and @plotlygraphs.

Written by

## Plotly

#### Plotly is a data visualization company that makes it easy to build, test, and deploy beautiful interactive web apps, charts and graphs—in any programming language.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just \$5/month. Upgrade