✚ How to Make Print-ready Graphics in R, with ggplot2

ggplot2 provides sensible default settings for analysis, but when you make charts for a publication, you often need to match an existing style and shift focus to readability over exploration. Design around a message or results instead of leaving interpretation open-ended. Finally, you need to export your charts in the required file format with the correct dimensions and resolution.

Become a member for access to this — plus tutorials, courses, and guides.

Generative art with R

Generative art seems to be having a moment right now, so it’s only appropriate that there’s an R package to help you make some. The aRtsy package by Koen Derks makes algorithms more straightforward to use. Set parameters and you’re off.

Tags: ,

✚ How to Use Packed Circles in R

Circle packing in visualization is a way to arrange circles in a fixed space so that none of the circles overlap, and if you were to increase the radius of any circle, it’d overlap with a neighbor. This can be a useful method to have in your toolbox to make various types of charts or to make existing charts more readable.

Become a member for access to this — plus tutorials, courses, and guides.

Value of R, the Statistics-specific language

Paul Ford has been learning R to better understand the field of Statistics. The takeaway:

Deep in its heart, R is a language for making charts, and it’s genuinely fun to go into its world: statistics, natural sciences, sociology — all right there. You will never pry me away from JavaScript or Python or the whole web stack of standards and protocols. They’re how I make things happen in the world, and they are very much my home base, but using more specific tools is always an education. It’s like suddenly discovering a new wing of a big museum, and realizing that there’s still a lot to learn.

I would say it’s a language for analyzing data, and charts are a big part of the process. But the big sell of R has always been its specificity. The need to understand data drives its design and growth, which means you avoid starting a lot of analyses from scratch.

Tags: ,

Average color of geographic areas

Based on satellite imagery, Erin Davis found the average color of places around the world. The above is by county in the United States, but Davis also made maps by country, which are a mix of greens, browns, and yellows.

See also the NYT piece from 2020, which framed color by political leaning.

Tags: , , ,

✚ How to Make Alluvial Diagrams

An alluvial diagram is a type of flow chart that is useful to show change over time. You see how individual categories and how the composition of the categories shift.

Incorporate ranking into the mix at each time segment, and you get a good idea of how order changes over time too. The geometry is like a combination of a stacked bar chart and a bump chart.

I made a set of them to show how food consumption changed, based on data from the United States Department of Agriculture. For example, here’s meat and protein consumption from 1970 through 2019:

Each band represents pounds per year per capita over time. See the full set here.

In this tutorial, I describe not only how to make a basic chart, but how you get from raw data all the way through the design process, to clear and readable graphics, and to the finished project.

Because chart generation is the easy part. Everything before and after is what makes the charts better.

Become a member for access to this — plus tutorials, courses, and guides.

Transform an image into a pixel-ly visual

Here’s a fun interactive by Duc-Quang Nguyen. Upload an image and get back a transformed visual that uses dots, lines, or ascii. Use the menu options to easily change resolution, colors, and shapes.

It’s a combination of Georgios Karamanis’s code and Elana Levin Schtulberg’s experiment of the same ilk.

Tags: , ,

✚ Making a Quick, Custom Prevalence Map – The Process 139

Welcome to issue #139 of The Process, the newsletter for FlowingData members where we look at how the charts get made. I’m Nathan Yau, and this week I’m describing my process behind a quick map. You can download the code at the end of this issue.

Become a member for access to this — plus tutorials, courses, and guides.

Send postcards of plots made in R

How many times have you made a plot in R and thought, “I wish I could send this as a postcard to my best friend.” Probably a million times, right? Wish no more. The ggirl package (that’s gg-in real life for short) by Jacqueline Nolis lets you send a plot over the internets to a postcard API, which sends a physical card to an address you specify.

Tags: , , , ,

✚ How to Make Ternary Plots in R, with ggplot2

When you want to compare between three parts of your data, ternary plots might be a good option. Here is how to make them. Read More