cxli233 /FriendsDontLetFriends

Friends don't let friends make certain types of data visualization - What are they and why are they bad.

★ 7,195⑂ 292👁 131⑃ 9● 8▤ 10
RCreated 2022-05-25
7,195
stars
+0+2+48
292
forks
131
watchers
9
prs
8
issues
10
releases
–
discussions

README

Friends Don't Let Friends Make Bad Graphs 





Friends don't let friends make certain types of data visualization - What are they and why are they bad. 

 Author: Chenxin Li, Ph.D., Assistant Professor at Department of Plant Biology, Michigan State University. 
 Contact: [email protected] | @chenxinli2.bsky.social

This is an opinionated essay about good and bad practices in data visualization. 
Examples and explanations are below. 

The Scripts/ directory contains .Rmd files that generate the graphics shown below. 
It requires R, RStudio, and the rmarkdown package. 

 R: R Download
 RStudio: RStudio Download
 rmarkdown can be installed using the install packages interface in RStudio

 Table of contents

1. Friends Don't Let Friends Make Bar Plots For Mean Separation
2. Friends Don't Let Friends Make Violin Plots for Small Sample Sizes
3. Friends Don't Let Friends Use Bidirectional Color Scales for Unidirectional Data
4. Friends Don't Let Friends Make Bar Plot Meadow
5. Friends Don't Let Friends Make Heatmap without Reordering Rows & Columns
6. Friends Don't Let Friends Make Heatmap without Checking Outliers
7. Friends Don't Let Friends Forget to Check Data Range at Each Factor Level
8. Friends Don't Let Friends Make Network Graphs without Trying Different Layouts 
9. Friends Don't Let Friends Confuse Position and Length Based Visualizations 
10. Friends Don't Let Friends Make Pie Charts 
11. Friends Don't Let Friends Make Concentric Donuts
12. Friends Don't Let Friends Use Red/green and Rainbow for Color Scales
13. Friends Don't Let Friends Forget to Reorder Stacked Bar Plot
14. Friends Don't Let Friends Mix Stacked Bars and Mean separation
15. Friends Don't Let Friends Use Histogram for Small Sample Sizes
16. Friends don't Let Friends Use Boxpot for Bimodal Data

 1. Friends Don't Let Friends Make Bar Plots for Means Separation

This has to be the first one. 
Means separation plots are some of the most common in scientific publications. 
We have two or more groups, which contains multiple observations; they may have different means, variances, and distributions. 
The task of the visualization is to show the means and the spread (dispersion) of the data. 

!No Bar Plots for Means Separation 

In this example, two groups have similar means and standard deviations, but quite different distributions. Are they really "the same"?
Just don't use bar plot for means separation, or at least check a couple things before settling down on a bar plot. 

It's worth mentioning that I was inspired by many researchers who have tweeted on the limitation of bar graphs. 
Here is a publication: Weissgerber et al., 2015, PLOS Biology. 

 2. Friends Don't Let Friends Make Violin Plots for Small Sample Sizes 

This is quite common in the literature as well, but unfortunately, violin plots (or any sort of smoothed distribution curves) make no sense for small n. 

!Beware of Violin Plots for Small Sample Sizes 

Distributions and quartiles can vary widely with small n, e

Snapshot: 2026-11-04T14:00:00Z · Data license Apache-2.0 · JSON