Skip to content

Commit

Permalink
Updates to good graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
Susan Vanderplas committed Feb 18, 2025
1 parent 598d77c commit 7c76620
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 1,599 deletions.
4 changes: 2 additions & 2 deletions _freeze/part-wrangling/02b-graphics/execute-results/html.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion part-wrangling/02b-graphics.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ I don't recommend you try to become proficient in all of them.
Before we delve into the grammar of graphics, let's motivate the philosophy using a simple task.
Suppose we want to create a pie chart using some data.
Pie charts are terrible, and we've known it for 100 years [@croxtonBarChartsCircle1927a], so in the interests of showing that we know that pie charts are awful, we'll also create a stacked bar chart, which is the most commonly promoted alternative to a pie chart.
We'll talk about what makes pie charts terrible at the end of this section in [Creating Good charts](@sec-good-graphics).
We'll talk about what makes pie charts terrible in @sec-good-graphics.


::: {.callout-caution collapse=true}
Expand Down
1,590 changes: 0 additions & 1,590 deletions part-wrangling/02c-good-graphics.html

This file was deleted.

14 changes: 10 additions & 4 deletions part-wrangling/02c-good-graphics.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

## {{< fa bullseye >}} Objectives

- Evaluate existing charts and develop new versions that improve accessibility and readability

- Understand what features make graphics effective
- Evaluate existing charts for accessibility and readability
- Make improvements to charts to increase comprehension and accessibility

A chart is good if it allows the user to draw useful conclusions that are supported by data. Obviously, this definition depends on the purpose of the chart - a simple EDA chart is going to have a different purpose than a chart showing e.g. the predicted path of a hurricane, which people will use to make decisions about whether or not to evacuate.

Expand Down Expand Up @@ -177,9 +178,14 @@ This can result in odd things, like the checkerboard and shadow shown in @fig-ch
- If you are using a color gradient, use a monochromatic color scheme where possible. This is perceived as light -\> dark by colorblind people, so it will be correctly perceived no matter what color you use.
- If you have a bidirectional scale (e.g. showing positive and negative values), the safest scheme to use is purple - white - orange. In any color scale that is multi-hue, it is important to transition through white, instead of from one color to another directly.
- Be conscious of what certain colors "mean"
- Leveraging common associations can make it easier to read a color scale and remember what it stands for (e.g. blue for cold, orange/red for hot is a natural scale, red = Republican and blue = Democrat in the US, white -\> blue gradients for showing rainfall totals)
- Leveraging common associations can make it easier to read a color scale and remember what it stands for
- blue for cold, orange/red for hot is a natural scale
- red = Republican and blue = Democrat in the US (since ~1980)
- white -\> blue gradients for showing rainfall totals
- Some colors can can provoke emotional responses that may not be desirable.[^10-graphics-2]
- It is also important to be conscious of the social baggage that certain color schemes may have - the pink/blue color scheme often used to denote gender can be unnecessarily polarizing, and it may be easier to use a colder color (blue or purple) for men and a warmer color (yellow, orange, lighter green) for women[^10-graphics-3].
- Consider the social baggage that certain color schemes may have
- pink/blue color scheme often used for gender may be polarizing
- Consider using a cooler color (blue or purple) for men and a warmer color (yellow, orange, lighter green) for women[^10-graphics-3].
- There are packages such as `RColorBrewer` and `dichromat` that have color palettes which are aesthetically pleasing, and, in many cases, colorblind friendly (`dichromat` is better for that than `RColorBrewer`). You can also take a look at other [ways to find nice color palettes](https://lisacharlotterost.de/2016/04/22/Colors-for-DataVis/).

[^10-graphics-2]: When the COVID-19 outbreak started, many maps were using white-to-red gradients to show case counts and/or deaths. [The emotional association between red and blood, danger, and death may have caused people to become more frightened than what was reasonable given the available information.](https://www.esri.com/arcgis-blog/products/product/mapping/mapping-coronavirus-responsibly/)
Expand Down

0 comments on commit 7c76620

Please sign in to comment.