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’m at the end of a day after I pulled an all-nighter trying to hit a grant proposal deadline. I don’t recall ever doing this in college. I seem to pull an all-nighter every five years or so. I’m too old for this! Anyway, the proposal is in and now I’m ready to move on to fun things… like talking to you about visualizing data! A few years back Whitney Battle-Baptiste and Britt Rusert put together an amazing collection of visualizations by WEB DuBois that he presented at the 1900...
Hey folks, Wow, I really didn’t expect my overview of Positron to resonate with so many people last week on YouTube! I’ll work on coming up with another video showing Virtual Studio Code (VS Code) in action. As others have mentioned in the episode’s comments, I’m not really sure why Posit is building Positron instead of making things easier within VS Code for R users. To me the need for an IDE that allows people to use multiple programming languages is a red herring - VS Code does that...
Hey folks, I hope you’ve noticed that this newsletter and the YouTube channel have nearly caught up. At this point there’s a 10-day lag between when I post a newsletter describing a data visualization and when I post the recreation video. I could possibly push that to a 3-day lag, but I’d like people to have a chance to work through the code on their own before I give my solution. After having existential dread last week that I’d never find another good plot to share, it appears my cup...