Using ggplot2-like plots

Ggplot2 is an R library for data visualization popular among R users. The main idea of ggplot2 is that the product of data visualization consists of many layers. Like a painter, we start with an empty canvas and then gradually add layers of paint. Usually, we interface with R code from Python with rpy2 (I will discuss several interoperability options in Chapter 11, of my book Python Data Analysis). However, if we only want to use ggplot2, it is more convenient to use the pyggplot library. In this recipe, we will visualize population growth for three countries using Worldbank data retrievable through pandas. The data consists of various indicators and related metadata. The spreadsheet at http://api.worldbank.org/v2/en/topic/19?downloadformat=excel ...

Get Python Data Analysis Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.