Get startedGet started for free

Aesthetics best practices

1. Aesthetics best practices

Now that we know what visual aesthetics are, how do we choose the right one?

2. Which aesthetics?

There is some creativity involved, but there are some helpful guidelines. This chapter is informed by the seminal work of cartographer Jacques Bertin, who published The Semiology of Graphics in 1967 and William Cleveland, whose research on perception was summarized in two books.

3. Form follows function

The best data viz serves a purpose - that is, form follows function. So what is the function in data viz? Well, it depends on your audience. You may just want to confirm expectations and begin analyzing your data, or you may want to inform a specific reader and persuade them with your results.

4. Form follows function

First and foremost, our function is the accurate and efficient representation of data. Beautiful is nice, but it's a secondary priority here. If data is not accurately and efficiently presented, it's junk. The function is never to misrepresent or obscure our data. We can avoid this by always considering the intended audience and purpose of our plots. So how do we do this?

5. Calculating statistics

Let's look at a simple example. In this data set, I have two continuous variables, x & y, y is a function of x. There are two groups, A and B.

6. Calculating statistics

It's pretty difficult to obtain summary statistics just by looking at the data.

7. Extracting information from Data

So we have two choices, numeric summaries, which are precise but offer a poor overview, or data visualization, which is imprecise but is great for overviews.

8. Encoding numbers into plots

To make a plot, we encode data in numbers and text into a visual medium. That's what we do with aesthetic mappings.

9. Various aesthetic mappings

These plots differ in their aesthetic mappings and other values that we'll explore throughout the courses.

10. Decoding to data

These visuals are then decoded to form an image of the original data. It's inherently imprecise - kind of like translating between two languages.

11. The best choices for aesthetics

We consider the best choices to be those which are both efficient, in that they are faster than numeric summaries, and accurate, in that they minimize this information loss.

12. Aesthetics - continuous variables

The choice of aesthetic mapping depends on the type of variable. The scatter plot is so easy to understand because it maps data as position on a common scale.

13. Aesthetics - continuous variables

Imagine if we switch the aesthetic mappings for x and color. This is possible, but is neither accurate nor efficient. In the worst case scenario, there is no way to see the relationship between these three variables, and in the best case, our reader will interpret the plot in an unintended way.

14. Efficiency of decoding

There are many choices for mapping continuous variables. For example, position on unaligned scales, as in having many plots with different scales but the same data type

15. Three iris scatter plots

like this example where we had three plots from the iris wide2 data frame, one for each of our iris species

16. Three iris scatter plots, unaligned y-axes

on unaligned y axes, is less efficient and makes it difficult to compare plots compared to

17. Single faceted plot, common y-axis

an aligned scale.

18. Decoding categorical

There are also a variety of choices for categorical data.

19. Aesthetics - categorical variables

Color is often used to good effect for a categorical variables. But efficiency and accuracy are not only functions of aesthetic mappings. This plot suffers from over-plotting since not every point is visible. Over-plotting is an issue whenever we have points, like in a scatter plot.

20. Aesthetics - categorical variables

We'll see lots of examples of over-plotting and how to deal with it in the exercises. Here, we'll want to adjust position to add some random noise, and attributes, which we've already seen.

21. Now it's your turn

Let's head over to the exercises and play around with these concepts further.

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.