Chapter 9. Matplotlib in the Real World
In this chapter you will see several examples of Matplotlib usage in real-world situations, showing some of the common cases where we can use Matplotlib to draw a plot of some values.
There is a common workflow for this kind of job:
1. Identify the best data source for the information we want to plot
2. Extract the data of interest and elaborate it for plotting
3. Plot the data
Usually, the hardest part is to extract and prepare the data for plotting. Due to this, we are going to show several examples of the first two steps.
The examples are:
Plotting data from a database
Plotting data from a web page
Plotting the data extracted by parsing an Apache log file
Plotting the data read from a comma-separated values (CSV) file
Plotting extrapolated data using curve fitting
Third-party tools using Matplotlib (NetworkX and mpmath)
Plotting geographical data using Basemap
Let's begin
Plotting data from a database
Databases often tend to collect much more information than we...