What visualization approach would you use instead of these pie charts?


Hey folks,

As I mentioned last week, I’m exploring the possibility of holding live, in person, workshops again like I did before the pandemic. If this is something that interests you, please let me know. My thought would be to hold them at an affordable hotel near the Detroit airport (DTW). But, if you would like to host me to teach a workshop, I would be open to that as well.


This week, I want to call your attention to a plot that I would not encourage you to make. This comes form “Targeted innate immune inhibition therapy compared with antibiotics for recurrent acute cystitis: a randomized, open-label phase 2 trial”, which was published recently in Nature Microbiology by Ambite and colleagues.

To be perfectly honest, whenever I see a pie chart I tell myself, “Surely there was a better way… What would have been better?” I’ll be talking more about this in the critique video next week, but how about taking some time to think about it now?

As always, we need to think about the context. The study had 20 people receive anakinra (an immunologic) and 10 receive nitrofurantoin (an antibiotic) to compare the safety and efficacy of the drugs in treating recurrent cyctitis, a type of bladder infection. Although I’m sure the developers of anakinra would have loved to see it perform better than nitrofurantoin, they also would have been happy to see the drugs perform equally. That’s because of concerns over antibiotic resistance. Does this context help you think about the design of this panel?

What is being compared? It isn’t change in symptoms back to day 1. It’s the comparison between the two drugs at each of the four time points. Those P-values are an output of testing the comparison and that all four are non-significant is one indication that anakinra is not inferior to nitrofurantoin. That test is comparing the distribution of the change in symptoms for the patients on the two drugs. It’s basically asking whether each pair of pie charts are different from each other.

I can more or less see what they want me to see with the pie charts. But I think there’s a design that would be easier for me to see the similarity. Let’s think about a couple of other designs.

First, my go to approach when pie charts are proposed is to facet the x-axis by the response variables (e.g. all symptoms gone, some symptoms gone, same symptoms or worse) and put the values next to each other that we’d like to see. In this case, I’d put time across the x-axis and the percentages on the y-axis. At each time point, I’d dodge the data by the three levels of response. Then I’d give a different color to the two drugs and plot the data as a point. Something that I gives me pause in thinking about this is that the comparison is across all the response variables, not each response individually.

Second, and I know this will shock many, what if we converted those pie charts into … stacked bar plots? Again, on the x-axis we’d put time and the y-axis the response, but we’d give each segment of the column a different color. We’d also put the stacked bar for each drug and time point next to each other. Aside from wanting to compare all three responses across the drugs together rather than individually, there’s another reason I’m open to this strategy. Namely, because there are only three responses. We could put the “all symptoms gone” on the bottom of the stack, “some symptoms gone” in the middle, and “same symptoms or worse” on top. If you wanted to compare individual responses as a secondary question, two of the three categories would have a fixed edge along the y-axis for making comparisons.

What do you think? Have I lost touch with reality?! Something that gives me a bit of pause about this approach is that we’re “hiding” the fact that there were 20 people in the anakinra group and 10 in the nitrofurantoin group. That’s why the comparison at 6 months looks different, but has a non-significant P-value. Effectively, the error bars for the nitrofurantoin are larger than they are for anakinra. This is made clear in the figure caption, but I feel like it is lost in the visual itself. Perhaps instead of putting the percentages in the tiles of the stacked bars we could put the actual number. Again, because we only have 3 categories, I think we could get away with adding those numbers without overwhelming the appearance of the figure.

Let me know what you think. Stay tuned until next week to see how they look when I give both approaches a try.

Workshops

I'm pleased to be able to offer you one of three recent workshops! With each you'll get access to 18 hours of video content, my code, and other materials. Click the buttons below to learn more

In case you missed it…

Here is a livestream that I published this week that relate to previous content from these newsletters. Enjoy!

video previewvideo preview

Finally, if you would like to support the Riffomonas project financially, please consider becoming a patron through Patreon! There are multiple tiers and fun gifts for each. By no means do I expect people to become patrons, but if you need to be asked, there you go :)

I’ll talk to you more next week!

Pat

Riffomonas Professional Development

Read more from Riffomonas Professional Development

Hey folks! I’m hoping to host two workshops in March and April. The first would be a Zoom-based workshop on the principles of data visualization (I taught a version of this last month). This would be a code-free workshop and would run for about 3 hours. I don’t have a date yet. If you are interested, please reply to this email and let me know if there is a date and time in March that would work best for you. The second would be an in person 3 day workshop taught near the Detroit airport. I...

Hey folks, We had a lot of fun last week with my first workshop on the theory of data visualization! If this is something that you’d be interested in participating in let me know. At this point, I don’t have anything scheduled. So, if you have suggestions for days or times, please let me know This week I have a fun figure to share with you from a paper recently published in Nature Microbiology, titled, “Candida auris skin tropism and antifungal resistance are mediated by carbonic anhydrase...

Hey folks, Happy 2026! It’s great to be joining you on another trip around the sun as we explore data visualization, R, and reproducible research. Later today I’ll be hosting a workshop on the design of data visualizations. If you register ASAP, I can probably still get you in. If you missed this one, but would like to be notified when I run this workshop again, reply to this email and let me know! This week I found a pretty unique plot type in a paper published in the journal Nature This is...