Are you ready to scrap using Illustrator to compose your multi-panel figures?


Hey folks!

I hope you enjoyed last week’s series on the radial volcano plot (newsletter, critique video, livestream). I think it did a good job of illustrating the various reasons I think it’s valuable to recreate figures, even if we don’t like how they display the data.

Something I didn’t really emphasize in last week’s newsletter was that by recreating a figure, we can make sure that the data are legit. I’m surprised by the number of signals I’ve been finding where authors using tools like Illustrator to compose their figures. I don’t hope to convince everyone to uninstall Illustrator, but hopefully people can be more careful about moving axes independently of the data! Yikes. Also, in the radial volcano plot we saw that they were plotting the raw P-values rather than the adjusted P-values. None of these observations have resulted in fundamental changes to the interpretation of the data, but they do show signs of carelessness in working with data.

If I’m honest, it reminds me of the very real problems caused by image splicing and manipulation that was rampant in the scientific literature. Again, I don’t think I’m finding data manipulation that warrants retractions or even corrections, but it does cause me some concern. What do you think? Is this a real problem or a nothing burger?


This week, I have another figure from Nature Microbiology to share with you. It’s Figure 1b from the paper, “A drug–microbiome–drug interaction impacts co-prescribed medications for Parkinson’s disease”, which was authored by Andrew Verdegaal and colleagues in Andy Goodman’s lab at Yale University.

Before talking about this panel, go check out panel 2c for another volcano plot. Similar to last week’s volcano plot, they seem to have used y-axis labels that don’t fit with the y-axis title. I like this label format, but the axis title needs some help. Interestingly, in panels 1j and 3j they use the traditional formatting of the y-axis. Anyway, I’ve talked enough about volcano plots. Let’s talk about heat maps :)

I’ll have plenty to say about this plot in Monday’s critique video. For now, let’s think about how we’d go about composing this panel. When I look at this panel, I instinctively break it down into 5 parts. The first is the flow diagram from tolcapone to tolcapone M2 in the left-hand column. I’d create this “plot” using geom_richtext() similar to how we worked with the images a few weeks ago. In the right-hand column there are 4 plots. The top panel is a barplot displaying the tolcapone IC50 for each of the bacterial species. In {ggplot2} this could be generated using geom_col(). Then we have three heatmaps showing the concentration of the three compounds after incubation for different durations with each of the bacteria. Each of these could be generated using geom_tile().

With these five images, how do we compose them together? You might already have caught on that the answer isn’t Illustrator :) Let’s try to use {patchwork}. Looking at the documentation, I think this page has nearly everything we’ll need to compose the figures. Of course, we’ll need to generate the 5 plots and save them as objects.

In the past we’ve talked about gathering together scales/legends with {patchwork} plots, but in this case we want to leave each color gradient scale with its respective heatmap. But, we do want to gather together the x-axis labels across each of the 4 plots in the right-hand column. To accomplish that, we can add plot_layout(axes = "collect") to our {patchwork} pipeline.

The “trick” here is that the labels on the x-axis will need to be the same in each of the four plots. That should be easy enough to pull off. I would likely use element_markdown() from {ggtext} to change the color of the font to differentiate between the sensitive (orange) and resistant (black) species. We can do that by using something like *Anaerococcus hydrogenalis* for the species labels.

Finally, as a bit of foreshadowing to the critique video, the “rules” I mentioned a few weeks ago included putting the most important variables on the x and y-axis and to put things next to each other that you want me to compare. With these rules in mind, I’m becoming convinced that 90% of what is displayed as a heatmap should not be a heatmap. Can you sketch a version of this panel that doesn’t use heatmaps?

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! Before launching into this week’s visualization, I’m looking for a bit of feedback. Since November, I’ve settled into a new routine with this newsletter and the YouTube channel. Each week this newsletter introduces a visualization at a 30,000 ft view or discusses a specific topic in some depth (example). The following Monday I post a video critiquing the visualization (example). Then on Wednesday (or Tuesday like this past week), I livestream a video where I recreate the...

Hey folks! I just got back from a seminar. I’m still trying to stretch out my eyes from straining to see the small text on each slide! If you don’t know why I’m brining this up, then you must have missed the videos I posted earlier this week. I was discussing the factors we should consider when converting figures designed for papers to figures designed to a slide deck. You can see me critique a figure from my own lab here and the livestream where I refactor the figure can be found here. I’d...

Hey folks, I was a student-invited speaker at the Syracuse University Biology department this week. It was great to meet with them and hear how they are benefiting from these newsletters and my videos. As much as I love posting newsletters and videos, seeing people light up at ideas, laugh at my jokes, and tell me how they are using what I teach them is like jet fuel. I actually gave two talks. One talk covered what I’ve learned about data visualization by critiquing, recreating, and remaking...