Graphic Design


The purpose of this topic is to learn some fundamental design guidelines and apply that knowledge to create data visualisations that are visually appealing (or at least not horribly ugly). This topic also covers fonts.

These guidelines are not just about making an image look pretty; a lot of the reason for these guidelines is about making an image work effectively by providing structure and being more organised. An ugly data visualisation is probably also a less effective data visualisation.

Of course, prioritising style over substance would also be a mistake, so we should not forget the guidelines for effective data visualisations and the visual perception principles from previous topics.

We are back to a less formal set of guidelines in this topic, with a lot of subjectivity about what “looks good”, however there is a pretty common consensus on these main points.

Introduction

Designing a visually appealing image from scratch requires artistic training, talent, and experience.
Even when we can identify that we like one image more than another, we may have no idea of what makes one image more appealing than another. This topic introduces a basic framework for assessing features of an image that are known to work well for most people. This will allow us to identify what is good about an image and provide some ways in which we can attempt to improve an image.

CRAP design

The “The Non-Designer’s Design Book” by Robin Williams proposes four major design features that make an image more appealing and more effective: Contrast, Repetition, Alignment, and Proximity (CRAP).

  • Contrast is the idea that elements of an image should be either very similar or very different. If elements of an image are supposed to be different, make them obviously different.

    Emphasising different elements of an image can assist the viewer to identify and focus on the important parts of an image. Furthermore, subtle or ambiguous differences can make an image distracting or even irritating.

    For example, in the plot below, all elements are the same colour and text mostly uses the same size and weight. It is not clear what we should focus on in this image.

    In the plot below, the data points and the title are much darker than everything else. Now there is a clear distinction that emphasises some elements over others. We can, for example, easily focus on just the title and/or the data points, without being distracted by the other elements of the plot.

  • Repetition means that specific colours or styles should be used to tie elements of an image together. This helps to create a more consistent, more cohesive, less chaotic, image.

    This has an obvious application in data visualisation when we identify a group of data points by filling them with the same colour. The plot below shows a slight extension of that idea: when a plot has a legend, the colours used in the main are plot repeated in the legend. Notice that there are other repetitions in this plot, with, for example all de-emphasised labels and axis tick marks drawn in the same shade of grey; all “background” elements have the same style.

    This guideline is also important when we produce several data visualisations within a report - in that case it is important to maintain a similar style across multiple data visualisations.

  • Alignment means that all elements of an image should be aligned with some other anchor point in the image. This helps to create organisation and structure within an image, which can make it easier to navigate within the image.

    The plot below is similar to the previous one except that all elements of the plot are aligned with an edge of the plot region (or a mark on an axis or another element of the plot). For example, the top element of the legend is vertically aligned with the top of the plot region and the bottom element of the legend is horizontally aligned with the top element of the legend.

  • Proximity means that elements of an image should be placed close to each other to form sub-elements of the image.

    In the plot below, the axis labels have been moved closer to the tick marks on the axis, which emphasises that they belong together. Similarly, the elements of the legend are closer together to identify the legend as a single sub-element of the plot.

Some of these changes can be quite subtle, but the final image is clearly more organised and structured, and therefore easier to navigate, and arguably much nicer to look at than the default plot that we started with.

The Readings from Reynolds and Heiss provide more examples of Contrast, Repetition, Alignment, and Proximity, within a broader design context - it will be up to us to apply these principles to a data visualisation context.

Fonts

One feature of an image where we can easily create contrast and repetition is in the choice of font for text.

For example, the plot below further emphasises the contrast between the title and the other text in the plot by using an extra bold font for the title and a more condensed and lighter weight font for the other text.

The Reading on Fonts in R describes how we can control the selection of fonts in R.

Software

We will make use of ‘ggplot2’ as usual, but we will need to, for example, make heavy use of themes to control fine details of a data visualisation and in some cases we may need to use ‘grid’ to get exactly what we want.

We will also make use of the ‘ggtext’ package for fine control of text.

Readings:

  • Sample pages from “Presentation Zen: Simple Ideas on Presentation Design and Delivery” by Garr Reynolds. You can ignore the first and last pages.

    This provides a description of the core design ideas of Contrast, Repetition, Alignment, and Proximity.

    It talks a lot about designing slides for presentations, but the basic ideas translate to any design problem, and it does have a couple of examples of data visualisations!

  • Slides 9 to 32 of the Graphic design topic of “Data Visualization with R” by Andrew Heiss.

    These slides provide examples of CRAP design, including font selection. They also repeat some of the material on colour from the previous topic.

  • A brief description of “Fonts in R”.

    This describes the basics of how to specify fonts when drawing text in R graphics. This also links to a document on “Graphics Devices in R”.

  • “Improved text rendering support for ggplot2” by Claus O. Wilke.

    This describes how the ‘ggtext’ package can be used to control the formatting of text in a data visualisation in R.

References:

Bibliography:


Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.