Break your bar chart habit
By: Nancy Organ
Tags: Design, Data Visualization, Data Science

Data

Data visualizations invariably require some kind of data — this should be no surprise. For the purposes of visualization, however, we care more about the shape of the data than the actual values themselves. That’s how we are able to create dashboards that update when new data are supplied.

Data are certainly important in a data visualization, but the shape of the data is more grammatically relevant to the chart than the values themselves.

In order to cut a data set that is the correct shape for your visualization, you’ll first need to consider what you would like to say with your data. I won’t cover that entire thought process in this piece, but take a look at the article I wrote about data visualization “therapy” for some tips on how to get at your main message:

Geometric objects

The predominant shape or shapes you select will vary depending on the message you’re trying to convey. There are some safe rules of thumb, but bear in mind in mind that exceptions abound. That said, lines tend to be good at emphasizing change within groups and points tend to do well at demonstrating relationships between discrete entities. Box-and-whiskers or violins do a nice job of displaying distributions. Rectangles are an easy choice for comparing quantities.

The geometric object you choose to display your data will influence how your message is interpreted.

Aesthetic mappings

Once you’ve selected the shape that will hold your data, think about how those shapes will change based on the values. That could mean associating colors to categories or intensities, size to quantity, or any other number of visual traits that will encode the variation in your data.

Aesthetic mappings connect visual traits to variation in your data.

Scales

You’ve already used aesthetic mappings to establish relationships between characteristics in the data and visual attributes like size and color. Scales take that a step further by defining the specifics of these relationships. For example, you might decide to map groups in your data to colors using a categorical scale of pink, beige, and brown. In this case the legend would represent the categorical color scale. Similarly, you could map quantity to vertical distance using a scale of 0 to 10 where the y-axis is analogous to a legend for quantity.

Scales are the exhaustive range of possibilities that define the aesthetic mappings between geometric objects and visible qualities like color, size, and distance.

Position adjustment

How will each element be positioned relative to the others? Position adjustment gives you control over the shared spaces in which your geometric objects reside. Stacking or dodging bars are common examples of position adjustment. You might also use “jittering,” which is the process of adding a bit of aesthetically stochastic noise to points in a scatterplot to minimize overlap in dense areas.

Position adjustments prevent geometric elements from overlapping and can help emphasize different comparisons.

Statistical transformations

Are you showing aggregated quantities across groups? What about means, or perhaps a smoothed line? These are examples of operations performed on data called statistical transformations. In essence, if it isn’t a scatterplot or an unadulterated line chart, some statistical transformation has come into play.

Statistical transformations are operations on the raw data that result in a different display format.

Coordinates

Unlike statistical transformations that perform operations on the data themselves, the coordinate system you choose changes how the relationships between your data points are mathematically defined. For example, moving a bar chart from the Cartesian plane into polar coordinates results in a pie chart.

Most graphics are draw in the Cartesian coordinate system, but other mathematical spaces are fair game, too!

Faceting

Depending on the comparisons you are trying to make in the graph, you might want to use facets, also known as small multiples. Faceting comes in handy when you’d like to see patterns within subsets of the data relative to a common scale. Faceting side-by-side allows for comparisons with a shared y-axis, whereas displaying stacked facets allows for comparison across a shared x-axis. The latter is particularly useful if you are showing several groups’ behavior over the same time period.

Facets allow you to compare groups that share a common scale.

What about 3D?

Moving beyond two dimensions in space is a matter of mapping a third aesthetic to an axis-based scale. That’s it! If your data have a variable that works for faceting, you’ve really already created a 3D graphic. Similarly, if you are using color, size, or another continuous aesthetic you can attribute it to an axial scale.

3D spaces are 2D spaces with an additional scale — and that scale could be a continuous axis or more akin to a facet.

…and animation?

Like 3D graphics, animation is a special case of using time as an aesthetic mapping. You can think of animation as iteratively viewing facets over time.