Figures
If you ever need to present data in a plot or a figure it's essential to do it in a way that most efficiently communicates the data and the message. Figures, by their nature, typically have a lot going on and require some brain power to analyze. Optimizing your figures for maximum readability can help the reader understand the figure better, reduce strain, and look more professional, all of which make your job easier and help everyone understand the data presented quicker and perhaps better. Below I'll share some tips for data visualizations and some useful defaults.
First of all, I believe one of the best ways to do good data visualization is to steal from the best. I can definitely recommend looking at John Burn-Murdoch's work for the Financial Times for inspiration of layout of figures and aesthetic choices for plots and figures. Another excellent resource is The Economist's visual style guide where they lay out their defaults for figures for their articles.
Orientation
This is about both the orientation and the actual sizing of the figures. Orientation is perhaps the easiest: the figure orientation should be in landscape mode always unless it should be in portrait mode. So the default should be landscape mode, but if you are publishing a large figure with multiple subplots on an A4 print or sharing a figure to be read on a phone, then a portrait orientation could be justified but you have to know what you're doing. For basically any other situation landscape mode is the correct choice. It's very awkward having to push a portait-oriented figure into slidedeck to be shared on a screen. And putting a "long" figure in a presentation shown on a laptop or monitor means that the reader has to scroll too much.
Figure size
When exporting your figure from your program of course (e.g. R or Python
etc.) one can always specify the settings. I make most of my figures in
Python or R, but particularly the ggsave()
function from {ggplot2}
can be tricky to work with. I found that it's often best to just specify the
desired aspect ratio (e.g. a 5x3 ratio), dimensions (e.g. 4000x2400), and resolution
(e.g. 600 DPI) of the image beforehand and adjust the text sizes afterwards.
600 usually works well in the modern age since screens have become very high
resolution and storage space is cheap. A figure with the aforementioned settings
will be about 1 MB in size, which isn't much these days. But remember that
if you use a DPI of 300 instead, you should also adjust the dimensions accordingly.
For example I'd define the output like this:
ggsave(
filename = "plot.png",
width = 4000, height = 2400, units = "px",
dpi = 600
)
And then I'd use the generated image file as a guide to scale up different
elements in the image, for example by setting the plot title size using
theme(plot.title = element_text(size = 90))
to make the plot title
fit the desired dimensions of the image file. Repeat this for all elements in
your figure and you'll get a publication ready figure. It may seem cumbersome,
but for a figure important enough to save for publication, it's always worth
the investment.
For further inspiration and good advice on sizing and spacing you can have a look at The Economist's visual style guide mentioned above, where they lay out their guidelines for figures used in print and online at The Economist.
Color Palettes
Choosing the right colors for your figures may have a dramatic impact on the quality of your figure and the subsequent ability of your message to efficiently reach the reader. As in the Fonts section of this website, not choosing to alter the defaults is always the wrong decision. Of course, there's still a lot of bad choices one can make, but if you're in doubt, just rely on work done by others to help you along.
If you're making your figures in R using for example {ggplot2}
then one of the best packages to use is the {scico}
package, which stands for "scientific colors". This package implements a set
of color palettes developed
by geoscientist and designer Fabio Crameri which ensure visually attractive, distinguishable, and accessible colors for
all kinds of purposes. Other packages that may be useful are the {paletteer}
package which aggregates a number of nice color palettes, and the {ggthemes}
package which incorporates a number of nice styling functions for your plots.
Colors for sex and gender
The most obvious answer to show sex or gender in color is to use pink and blue for females and males respectively. This trend became widespread in the 1950s, and the 1950s are not known for their progressive view on sex and gender, so I'd always steer away from those at all times. Instead, modern variations that take into account current (Western) cultural associations are available that are both less traditional and more inclusive. Properly representing the gender spectrum in society is impossible, even the Pride flag is a simplication, but good choices can be made. An excellent resource for good colors to use is this article which shows how different brands and designers deal with color and gender and sex. The colors used by the BBC recently (purple for men, and mint green for women) is probably my favorite. Though the palette from The Economist mentioned in the article above is also quite nice. The palette chosen by The Telegraph has also grown on me. None of these palettes propose a separate color for "non-binary" people, but instead group them in a category denoted in grey. I'll list some options below.
Colors used by the BBC in 2024:
...by Financial Times, also in 2024:
...and by the same agency in 2018:
The palette by The Economist in 2018 was basically the same, but in reverse:
The Telegraph in 2018 also had a nice palette based on a palette used by the suffragette movement in the early 20th century:
As you can see, even today the colors that denote "male" are still a shade of blue, but design exists within a context. And suddenly making blue the hue that denotes "women" will make interpretation of your figure harder, but change is happening slowly.
Brand color palettes
Occasionally, it might be nicest to just use a color palette from an
external source like a particular software (like Tableau) or news agency. It's important to note that there ethical connotations to
trying to mimic an established and respected new source, so use these
color palettes responsibly. The color palettes below were extracted from the
{ggthemes}
package mentioned above.
Tableau
This color palette has a nice set of bright colors without any preset connotation, so it's applicable in many situations without raising any unwanted associations with existing brands.
Few
The following colors are a tiny bit more "pastel" than the palette above and originate from an article by Stephen Few where he proposes a few rules for using color in graphs based on his experience. This color palette also generally works well on a figure with a dark background.
Wall Street Journal
The Wall Street Journal uses a generally darker set of colors for their figures. The color palette is nice and saturated but particularly the first two colors (being red and blue) may have bring along political associations with the left and right political spectrum.
Five Thirty Eight
This color palette is very limited and it seems 538 (which is now defunt) prefered to keep the number of colors in their figures low, or use different shades instead. The three colors are bright and saturated, but the red might be too intense, drawing too much attention to itself compared to the blue and green colors.