This week, a student of my ggplot2 course asked how I go from a dataset to a polished graph.
It's a common (and important!) question. So here’s a quick overview of my process:
1️⃣ Explore first
I start by making lots of quick, messy plots. No styling, just raw exploration to understand what’s in the data and what story might be hiding.
I love using ggplot2 here: easy to filter, tweak, and switch chart types just by changing the geom.
Pro tip: The gt_plt_summary() function from gtExtras gives a great first glimpse of your dataset:
2️⃣ List the options
Next, I brainstorm every chart type that could work. It’s a good mental exercise, and harder than it sounds!
Even with just two columns, you could make a barplot, lollipop, donut, pie, circular barplot, choropleth, waffle chart and more.
To help with this, I made Data to Viz: a decision tree to explore all your options.
Pro tip: Don’t limit yourself to standard charts. Grab pen and paper and try sketching something new.
3️⃣ Pick the right one
Every chart type has its pros and cons. Here’s what I usually consider when picking the right one:
But honestly, the most important thing, by far, is to know what question you're trying to answer.
At the end of the day, your user should understand the key message in less than 20 seconds.
If you're trying to show a rank, a barplot is very powerful. But a treemap fails! If you want to highlight the proportion of a specific group, it's the opposite!
4️⃣ Add annotation
Choosing a chart is just the beginning. Now you need to tell the story.
Highlight key points. Write a clear, compelling title. Add direct annotations.
Your reader should never have to guess the takeaway.
Dataviz is iterative. You’ll cycle through these steps more than once—and that’s completely normal. We all do it! See you next week, Yan PS: I often present this process as a 1-hour interactive talk. If you'd like to boost your team's dataviz skills, feel free to hit reply! PPS: 1,443 of you have enrolled in my online courses (R, matplotlib, ggplot2). Thank you so much! 🎉🙏