Design Elements and Tidying Your Visualizations

Author

Amanda Ng, Abigail Frix

In this section, we focus on some tips to make your visualizations look polished and purposeful.

Color and Visual Elements

When choosing colors for your visualizations these are some things to keep in mind:

  • Choose colors that are colorblind-friendly (avoid relying solely on red-green distinctions)
  • Use a consistent color palette throughout your analysis
  • Limit your color palette to 3-5 colors maximum to avoid visual clutter
  • Use color strategically to highlight key findings, not just for decoration
  • Ensure sufficient contrast between elements for readability

Let’s look at an example for how to use color. First, let’s explore all the color options available in R:

Consider this map:

Compare the above version of the map with this one:

Referring to the beginning of this section, which map displays the data more meaningfully and is more visually appealing? Why?

Labeling Your Data and Text

Having clear, concise labeling for your data components is crucial in making your visualization accessible.

  1. Legends
  • Place legends where they don’t obstruct data points (usually top-right or bottom-right)
  • Use clear, descriptive legend titles and labels
  • Remove legends when they’re redundant (it. only one data series)
  • Make legend text large enough to read easily
  1. Axes and Scales
  • Start y-axes at zero for bar charts to avoid misleading comparisons
  • Use appropriate scale breaks and intervals that make sense for your data
  • Label axes clearly with units of measurement included
  • Rotate x-axis labels if they’re too long or crowded
  • Consider log scales for data spanning several orders of magnitude
  1. Titles and Fonts
  • Use readable font sizes
  • Keep titles concise but informative
  • Use consistent font throughout your visualization

Overall, and building on everything previously discussed, we want our data visualizations to convey meaningful information with as much organization and as little clutter as possible. Some final pointers:

  • Maintain adequate white space around your plot
  • Order categorical data logically (alphabetically, by frequency, or by meaningful hierarchy)
  • Remove unnecessary elements that don’t add to understanding

Example 1

If you saw this visualization given no context, you would not be able to make any sense of it for a variety of reasons.

Let’s transform it step by step:

Example 2

Similarly, this visualization given no context would be hard to interpretate.

Let’s transform it step by step:

Conclusions

Congratulations! Through completion of learnR module 2, you have familiarized yourself with some R code that will be useful for lab assignments, and modified and ran R code to wrangle and summarize data.

Return to Learning Hub Homepage

Learning Hub Homepage