Chapter 6. Plotting Charts with Images and Maps

This chapter contains recipes that will cover:

  • Processing images with PIL
  • Plotting with images
  • Displaying images with other plots in the figure
  • Plotting data on a map using Basemap
  • Plotting data on a map using the Google Map API
  • Generating CAPTCHA images

Introduction

This chapter explores how to work with images and maps. Python has some well-known image libraries that allow us to process images in both aesthetic and scientific ways.

First, we will introduce the capabilities of PIL (and its friendly fork Pillow), by demonstrating how to process images by applying filters and resizing them.

Furthermore, we will show you how to use image files as annotation for our matplotlib charts.

To deal with data visualization ...

Get Python Data Visualization Cookbook - Second Edition 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.