Two plotting examples from the textbook

Two plotting examples from the textbook are worth reading carefully. The first example comes from the CSV File Format section of chapter 16, and demonstrates how to use the csv module to read data stored in the popular CSV data format. The second example comes from the Mapping Global Data Sets section of that same chapter. That example demonstrates how to work with data encoded in the JSON format and how to use the pygal module to plot map data.

The source code and the data files for both examples are available below. To run the JSON example you will need to install pygal: check the ReadMe.txt file included with the example to see how to do that.

CSV Example

JSON example