Albert Rapp Profile picture
Nov 2 17 tweets 8 min read
I have 10+ years of university-level education.

But no lecture taught me how to create good visualizations.

These things are crucial for communication but are often not part of the training.

So, let's have a crash course on visualization guidelines anyone can implement. 🧵
1. Know your audience

You can't use the same visualization for every audience.

A plot that works in a scientific journal may bore (or confuse) non-scientists.
2. Know your takeaways

Forget the dream of putting ALL of your great insights into one powerful plot.

This. does. not. work.

If anything, this dream is a gateway to using too many chart types all at once.

Visualize only your most important insights (maybe in separate plots).
3. Use only a few chart types in one plot

A bar chart here. Add a line there. Include some points and text labels over there. And all of a sudden you've got a mess.

Here's a SWD makeover reducing the number of chart types. Looks cleaner, right?

Source: storytellingwithdata.com/blog/bar-chart… A bar plot combined with two lines for upper and lower thresRemodeled plot that shows the same data. Region lines were r
4. Be mindful of your color use

Colors are great. But they can easily overwhelm your reader.

There are two similar rules of thumb that can help to avoid that:

- Start with grey
- Emphasize just one or a few categories Multiple colored lines that depict the time we spent either All lines except two were greyed out so that it's not so col
5. Avoid rainbow colors

They can turn into a colorful rainbow mess pretty quickly.

Here are my go-to alternatives palettes:

Coloors generator: coolors.co/d9f4c7-f8fa90-…
Viridis: sjmgarnier.github.io/viridis/index.…
Okabe-Ito: mikemol.github.io/technique/colo…
6. Improve accessibility

The Viridis and Okabe-Ito colors are colorblind-friendly. But you can do more to make your plots accessible, e.g.

- Double-coding (like using color AND shape for categories)

- Adding alt-texts supercooldesign.co.uk/blog/how-to-wr…
6. Reduce clutter

Do you really need all labels? Or all grid lines or axes? Especially with labeled bar charts there is really no need to keep it all. Two bar plots that count penguins. The second bar plot strip
7. Align labels

Your plot feels more harmonious if labels are aligned and not spread out all over the place.

For example, what feels "smoother" in this image?

Remember that next time you create a table with centered columns. Two columns filled with one location per line. One column ce
8. Remove the legend and label directly

Do you really need a legend? It can take up sooo much valuable space of your plot.

Besides, switching back and forth from the legend to the plot can be quite challenging for your reader.

Instead, you can label directly. Once again the plot with the message "Around the age of
These were just a few of my most favorite dataviz "rules".

Of course, there's lots more to learn.

So let's talk resources.
Fundamentals of Data Visualization by @ClausWilke is a great resource to learn more about dataviz.

Best part? It's totally free and open-source.

clauswilke.com/dataviz/
Another great and totally free resource is

Data Visualization: A practical introduction by @kjhealy

socviz.co/index.html#pre…
I've also enjoyed the Storytelling with Data book.

It's pretty short but filled with insights. Unfortunately, it's not free.

amzn.to/3U0x0rM
Now, it's one thing to know the rules but it's another thing to apply them.

My recommendation? Practice with the weekly #tidyTuesday challenge.

Each week, a new data set for practicing your data skills is published.

A great competition for all levels. github.com/rfordatascienc…
If you're getting started with visualizations, you'll likely need help.

But don't worry, there are resources for templates/inspiration. Here are my 4 favorite helpers:

1️⃣ cookbook-r.com/Graphs/

2️⃣ r-graph-gallery.com

3️⃣ python-graph-gallery.com

4️⃣ data-to-viz.com
That's a wrap for today.

I hope that you enjoyed this little intro to data visualization 😊

Tomorrow, we'll explore common chart types and better alternatives.

If you want to be there or see more posts like that, you can follow @rappa753.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Albert Rapp

Albert Rapp Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @rappa753

Nov 4
I used to think tables are boring.

But they can be beautiful & engaging.

Here's a nice example from @infobeautiful.

It uses many eye-catching elements.

But you don't need catchy visuals to create a great table. Here are a couple of guidelines that will help you 🧵 A huge table describing wha...
Let's start with a not so great table and improve it.

Here's a table I would have created just a few months ago.

Not so sexy, right? Let's clean that up. An ugly table describing th...
1. Avoid vertical lines

The above table uses waaaay to many grid lines.

Without vertical lines, the table will look less cramped.

Have a look for yourself. Same table as before but wi...
Read 21 tweets
Nov 3
Some chart types are used all the time. Think:

Box plots
Pie charts
Heat maps
Paired bar charts
Correlation matrix

But just because a chart is used all the time doesn't mean it's good for your use case.

Let's explore some alternatives that may work better for you.
Let's start with something juicy. Here's a pie chart from the Wikipedia page on pie charts.

One major problem with it is that comparisons are hard for e.g. Australia and "Other".

That's a major reason why pie charts are are shunned in the dataviz community. Pie chart showing the relat...
But I do believe that pies are not as bad as some folks make it out to be.

It depends on the purpose. Was the chart intended to highlight mostly the US? Then go for it.

Do you want to compare the other countries too? Then a bar chart would be a safer alternative.
Read 20 tweets
Nov 1
There are hundreds of online resources for learning how to code.

But there are much fewer online resources for math.

Maybe that's because LaTeX (the premier math writing tool) isn't good at creating them.

#QuartoPub can do both. So, is it a worthy alternative?🧵 #mathematics
What is Quarto?

Short answer: It's a tool that can create many output formats all from one interface.

That means you can create classical PDF math papers as well as online math books with Quarto.
You may be sceptical about the online part. Maybe you have only seen math in PDF format.

But I assure you that it's a real thing. And it's powerful.

For example, every day hundreds of mathematicians on MathOverflow talk about research-level math online. mathoverflow.net
Read 16 tweets
Oct 23
Paired bar charts suck at comparing values.

Still, they're used all the time because they are easy to make.

But there are better alternatives that are just as easy.

Here's how to create 4 alternatives with #rstats. 🧵
0 // Where's the code?

The code for all plots can be found at albert-rapp.de/posts/ggplot2-…

This thread walks you through the code quickly.
1 // Dot plot

Instead of using bars next to each other, why not points on the same line?

Makes comparison suuper easy.

And it takes only a geom_point() layer. Dead-simple, right?

I think it's even easier to create than a paired bar chart.
Read 17 tweets
Oct 7
Powerful functions can improve your coding experience.

They will save you time and nerves.

Want to learn how to write better functions?

Let me walk you through two advanced #rstats concepts. 🧵
Imagine that you want to count variables in your data set.

I'll use the Palmerpenguins data for demo purposes here.

Check out how your code could look.
Notice how the logic is always the same and only the variable changes?

Let's pour that logic into a function.

Be careful, though. It's not as easy as it looks.
Read 12 tweets
Sep 30
BEFORE
- Standard bar chart
- No clue what the message is

AFTER
- Bar chart with nuanced color use
- Informs your reader about key insights & actions

The latter is actually pretty easy to pull off.

At the end of this step-by-step guide, you can do that too. #rstats #dataviz Image
Here's our starting point.

All code is available at albert-rapp.de/posts/ggplot2-…

Note that this tutorial is a ggplot2 recreation of Image
// Labels on y-axis

First, move the names to the y-axis.

This is important when the labels are real names instead of IDs.

No one likes to tilt their head for reading. Image
Read 20 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(