Resources

Who are 'the ggplot2 extenders' and how to become one (Gina Reynolds) | posit::conf(2025)

Who are 'the ggplot2 extenders' and how to become one Speaker(s): Evangeline 'Gina' Reynolds Abstract: The ggplot2 extension ecosystem is large and robust. Still, even for the most competent ggplot2 users, jumping into writing extensions may not feel straightforward. But the extension-interested should know, it is a great time to get into extension. New efforts exist to support and connect extenders! This talk will discuss some new getting-started resources for extenders and will highlight the ggplot2 extenders meetup and discussions. YouTube Playlist - https://www.youtube.com/playlist?list=PLpUeWjs9wDGc4C_Db_u4T7g_rDmw9ZkXE Join Form - https://docs.google.com/forms/d/e/1FAIpQLSe3M1KwUPrmTfEGuuQp0fZ0J7dZkk_82gb310JCvdouMTa_7Q/viewform Website - https://ggplot2-extenders.github.io/ggplot-extension-club/ posit::conf(2025) Subscribe to posit::conf updates: https://posit.co/about/subscription-management/

image: thumbnail.jpg

Transcript#

This transcript was generated automatically and may contain errors.

Hi, I'm Gina Reynolds, and my talk is titled, Who are the ggplot2 extenders and how to become one? So you may find this title to be a little bit of a bait and switch, because I'm not going to talk about the extension packages on Crayon, and who wrote them, and how that connects people, and who's contributing to what.

Although that sounds like a great talk and I'd love to go to it. But I'm going to talk about, instead, this group called the ggplot2 extenders, which I think you might find maybe even more relevant than that other talk.

Origins of the ggplot2 extenders group

So this group got started back in 2022, when I and Jun Choi were talking about ggplot2 extension, and we really liked extension, but felt that, you know, it was a bit hard to break into. And for me, at least, it was kind of like being on the outside of an exclusive club looking in.

And so I actually proposed to Jun that we start a club and maybe change that experience, if not for more people, at least for myself. And Jun agreed.

And so I actually proposed to Jun that we start a club and maybe change that experience, if not for more people, at least for myself.

And we started to think about who might else be interested. So we brought on Chun Vonderbrand pretty early on. Jun was aware of his work, and he's been involved since the early days and continues to be involved, which is really great, and Jun is a maintainer and developer of ggplot2 itself.

What the group does

So our main activity is to meet virtually and hear from ggplot2 extenders. And right now, we've heard from almost 30 projects, people on their projects. And basically, they go over their motivations for their project, challenges they face, and kind of how they overcame those challenges. Sometimes we get into the weeds. People kind of throw up GitHub repos and show code, which can be really fun.

And there's even more opportunity for that digging into the weeds over at our discussion page. So you can talk about things in between meetings. So if you're interested in Likert and other diverging bar plots, that's been a big point of discussion, check out discussion 18.

We're also interested in education, and we have some resources for people to get going with extension that we think could be really helpful that are going to take you all the way from, like, something that you probably are familiar with, like getting a job done in base ggplot2 if you're a ggplot2 user, all the way to your user-facing function, so geomedians in this case.

And as I mentioned, most of our meetings are virtual, and this means this is great because we can meet with people around the world pretty regularly, and it's made it easy to record some of our sessions. We have a small library of recorded sessions that you might consider checking out.

Very recently, this past August, we have had some in-person interaction, which has been fun. This is some of our presenters at a panel on extension at the Joint Statistical Meeting in Nashville. And this past year, Hadley won the graphics award for his work on ggplot2 and other projects, so it was great to celebrate on that as well.

We're also interested in Python and the grammar of graphics plot 9 project, especially. Hasan has presented in our group and often attends, so extension in that space should be interesting to follow, and we hope to support that.

How to join

So that's just a little bit of a background about our group, and this brings me to the question about how to become a ggplot2 extender. And I'm going to answer in this sense in the context of this group, and the answer to that question is pretty easy. So you can fill out our join form, and then we'll be in touch with you about coming to future meetings. And you can check out our website if you're wanting to dig in a little bit deeper and get a better sense of who we are.

And if you want to try some more extension before joining us, we don't feel like it's a requirement, but you can check out our easy join recipe. And I would say that it is a really great time to join if you're on the fence, because we're going to have a release party as our next meetup on ggplot2 version 4.0.0. It's going to be Friday, October 3rd, probably at 3 p.m. Eastern.

So that is like the main things that I wanted to get across in this talk. Just wanted folks to let more folks know that we exist and that you'd be welcome to join.

Why dataviz and ggplot2 matter

But I have made maybe a lot of assumptions with that message, right? It assumes that you're interested in DataVis and ggplot2 and extension. So maybe I should tackle some of those exceptions, and I've got some time, so I'll go ahead and do so.

And I'll motivate this part of the talk with a phrase that I'm hearing a lot, which I'm quoting my son, who we want to learn some Spanish. But you can see that we're having mixed results.

So this actually kind of resonates with me. I feel like there's a lot in common with what he's saying. Tell me in my dominant language. Tell me in this non-friction mode of communication, relatively.

And the reasons that I'm here. Because I might say something like, tell me visually. Tell me in pictures. I like when people sit me down and show me stuff in schematics. I think it's probably true of a lot of people, right? Because visualized information is a superhighway.

So visual information is pre-attentively processed. We don't have to exert a lot of effort to understand and see patterns in our data, distributions, outliers. All of that stuff is going to happen automatically and effortlessly.

So just returning to this language analogy. We are hearing a little bit more of dime en espanol. Tell me a story in Spanish. Talk to me in Spanish, which is great because we don't want to give up on Spanish. I think, you know, having two languages under your belt is really cool. And language is cool in general.

And, you know, there's a contrast to experiences between learning English and Spanish. And that can be cool. One of the contrasts is orthography. How we write stuff down. And in particular, like how we spell stuff. So in English, learning to spell can feel like a battle. Like it's a constant enterprise. You have to learn how to spell new words, word by word. Whereas with Spanish, you kind of learn to spell once. And once you learn to spell, then you can spell things how they sound. And there's kind of a lot of rules that are followed and letters that correspond to sounds. So writing things down and reading them back is very easy in Spanish.

And I think that sometimes when you hear about the motivation for ggplot2, it kind of sounds like this to me. I just want to spell my plot how it sounds. And so actually quoting Hadley on his motivation. He said this. You know, I'd get a data set that I could clearly picture. I'd want to put this on the X axis. Let's put this on the Y. Draw a line. Put some points here. Break it up by this variable. And then like getting that vision out of my head and into reality was just really, really hard. Felt harder than it should be. Like there's a lot of custom programming involved. And ggplot2 is really successful in giving us this write it how it sounds kind of experience.

And ggplot2 is really successful in giving us this write it how it sounds kind of experience.

We have a data set. We're going to put this variable on the X axis, this variable on the Y axis. Points are going to take on those positions. A line is going to characterize all those positions. And then we can break things up by another variable.

So the ggplot2 experience, if I was going to describe it, it's great, right? It's easy. It's articulated. It's staccato. Effervescent. It leaves us refreshed after a build instead of like mentally depleted so that we're energized and ready to kind of like make interpretations about the plot that we just built. It's a great combo, right? We're in this visual world. So information is processed effortlessly. And ggplot2 makes it almost effortless to build plots.

Where extension comes in

Except for sometimes that's not the case, right? So how do you say this in ggplot2? There's kind of limits to what you can do with base ggplot2. And, you know, at first building this plot is pretty staccato. But then when I want to draw a line at the mean, it does require a fair amount of thinking and thinking things through. And how would you say this? Well, if you want to look at group means, then you might be doing some precomputation. And then when you go ahead and plot those means, it also the code is a little bit verbose.

So what happens when ggplot2 isn't refreshing? An extender might step in and write up something that's a little bit more effervescent and bubbly. And that doesn't need to be like a very serious endeavor, especially when you're joining our group. We're not going to push you to write a package right away. You can just be playful with your extensions, too.

But an extension in this scenario might look like this. Geom xmean. And then for free, we get that group-wise computation.

OK, so I covered kind of these assumptions. I hope you're convinced that dataviz, ggplot2, and extension are all worthwhile and should be on your radar.

Things getting done: the ggsprings example

But one more question that you might have about the extenders is like, are you just a group of enthusiasts or are things getting done in this group? And I actually wish that I were spending more time on this part of the talk. But I'll just turn to this example, which is from a new package called ggsprings. And it lets you kind of reflect on this fact that there's actually a lot in common between our regression models and the physical world. So Hooke's law could be in play if there were springs attached to these points.

And there's a great blog post that Michael Friendly, who is the author of this package, was aware of by Joshua Luftus. And Joshua took some of the extension content from the ggplot2 extension chapter of the ggplot2 book and wrote a nice blog post about this fact. But Michael said, well, why isn't there a package for that? And wouldn't it be nice to have that available in a package shop? And he had just joined our group and had some questions about the specifics about how to do this.

And I think we were able to provide a lot of information and help in this project to make it that much stronger in the way of how to package in the ggplot2 context. And also how to make some of the functions a bit more comfortable for use in the context that you imagine. So you can imagine these functions being usable even by both instructors and students themselves if they were kind of passionate about these parallels that are happening between physical phenomenon and the stats world.

So that does bring me to the close of the talk. And I'll just close by saying I think I'm really excited to be a part of this group myself. And the membership is what makes the group so strong. And I think that your joining us could potentially be a real boon to this group. So I hope you'll consider it and enjoy ggplot2 extension that does come out of this group.

Thanks so much and looking forward to the Q&A.