O'Reilly logo

R Data Visualization Cookbook by Atmajitsinh Gohil

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Constructing maps with bubbles

You might have come across maps that look like choropleth maps, but for each region, there is a bubble or a pie chart that represents percentage. I personally prefer bubbles over pie charts on a map, but in certain cases where we need to identify data based on gender or some other categorical variable, pie charts can come in handy as well. The code to plot a pie on a map is discussed in the recipe Creating donut plots and interactive plots in Chapter 5, The Pie Chart and Its Alternatives.

The main motivation behind this plot is also derived from the New York Times infographic on global warming. The visualization displays a line plot along with the bubble plots. The line plot can be accessed by clicking the navigation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required