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
|
In case you missed it, I have nine kids ranging in age from 23 to 7 that my wife homeschools. They’re a riot. Each of them has to find a way to be different from all of the others. This makes for some real characters. Let me introduce you to Peter. This week, Peter, who is 11, has been working on a times table. You may remember these from when you were a kid. Say you want to know what 7 times 8 is (this was always my hardest “times” to remember). You take your finger down the rows to the...
Hey folks, I’m really enjoying sharing with you my 30,000 foot view of how I would go about making figures that I find in the “wild”. Following up on these emails with a couple of related YouTube videos has been a lot of fun for me. Of course if you find any figures you like, send them my way - I love seeing what interests you all. I was reminded recently though that not everyone feels enough confidence with their R and tidyverse skills to keep up. Sorry! Towards the bottom of this email I...
Hey folks, We’re still slogging our way through Thanksgiving leftovers. As time passes from last Thursday, there’s a fine line between setting a good example about not wasting food and setting a bad example by getting every food poisoning! Speaking of eating, our teeth are pretty important, don’t you think? In the US, Trump’s expected head for the Department of Health and Human Services has a number of interesting views about health. One example is that its a bad idea to spike our drinking...