Hey folks, I’ve submitted (and re-submitted and re-re-submitted!) the {phylotypr} R package that I’ve been developing on the YouTub channel. I’m optimistic that {phylotypr} should be on CRAN in the next few days. With that, I’ll be moving on to a new strategy with my videos. My plan is to take the narrative that I present in these newsletters and go through the process of re-producing the figures I discuss. I recorded the first one yesterday and I think you’ll really like this new series. Can you do something for me? If you’re like most of my colleagues, you probably have about 20 tabs open in your browser. I’d love it if you were to send me a copy of a figure in one of those tabs along with a link to the page. I really want to present figures that are relevant to your interests and work. This week, I have a figure that was published within an article on the local economy in Bridge Michigan, a non-partisan, non-profit news outlet where I live. As with last week, I want to encourage you to ask some questions about any plot you find to help you develop your taste and and think through how you would recreate elements of a plot. What type of plot is this? Aside from the data story, what is interesting about this figure? What do you like about it? What don’t you like about it? Can you outline the steps you would take to generate the figure? What are some of the steps you aren’t sure about and would like to learn? In case it helps, here’s some code to give you a data frame that you could use to play with some of our ideas.
This is a bar plot, somewhat similar to what I showed you last week. Here are five things that caught my eye (in order of difficulty-ish). First, the image has a main title, a sub title, and text at the bottom of the figure indicating the source. Second, the median earnings for each year is embedded within the bars. Third, the numbers on the y-axis are horizontal and sit on their grid line. Fourth, the x-axis has lines separating each year and the year 2020 is missing (sneaky!). Fifth, they have a legend directly above the bar plot, but rather than a square the symbol is a circle. First, let’s rough in a plot with the various titles. To review from last week, we can make a bar plot like this one by using A quick aside: One little hint that I usually forget is to go ahead and use Second, the median earnings for each year are embedded within the bars. This is a pretty cool alternative to placing the numbers in a small font above the bars, which is what I typically see. The value all have a dollar sign and a comma to separate in multiples of thousands of dollars. I generally make a column in my data frame called “pretty” for situations like this where I store the stylized value. You can use Third, I like the look of having the numbers on the y-axis be horizontal and sitting on their grid line. How would we pull this off? One thought was to use the Fourth, you’ve probably noticed that the year 2020 is missing (sneaky!) and our tick marks are aligned with the numbers rather than being dodged to the side. To close the gap, I’ll add a column to by table Finally, this figure has a legend. Why?! There’s one category. There’s no need for a legend! Regardless, there’s an opportunity to learn here. What I find interesting about the legend is that the symbol is a circle. Normally we get squares when we make a bar plot. There’s at least three ways to do this. First, I could probably use Phew. That’s a lot for what initially seemed like a pretty simple bar plot. There are a few other subtle things going on here that I’ll let you think about. First, I know there are ways of bringing in graphics like the watermark in the bottom left corner. I’m pretty sure we could use
|
Hey folks, I have long since given up trying to anticipate what types of videos will resonate with people on YouTube. One of my most popular videos shows people how to make stacked bar plots. Throughout it, I tell people that these are a horrible way to visualize data. It’s my third most viewed video. I thought a video on slope plots would be popular. Nope. People panned last week’s episode. But Venn diagrams - holy cats! People are really geeking out about this week’s episodes on Venn...
Hey folks, I’m really grateful for the people who have emailed me recently to thank me for making the recreation and makeover videos. I’ve been excited to see the types of figures some of you are trying to make. It’s really been a great part of this work for me. Thank you! Eric Hill is a loyal Riffomonas Channel viewer who recently sent me an animation he made using the p5.js platform. The animation shows his son’s performance relative to other runners in the prestigious Nike Cross Nationals...
Hey folks, One of the benefits of sending out these newsletters and making my YouTube videos is that I get a ton of practice. I can’t emphasize how much practice has paid off in learning to use dplyr, ggplot2, and other packages. Reproducing published figures has really helped me to dive into parts of ggplot2 that I wouldn’t normally use because I make plots that use the features of ggplot2 that I know. By expanding my knowledge of ggplot2, I’m finding that the plots I make from scratch are...