pyplot vs object-oriented interface

Matplotlib has two interfaces: the object-oriented interface renders Axes instances on Figure instances, while the less flexible state-based MATLAB style-interface keeps track of the current figure and axes and other objects and directs plotting functions accordingly (more here).

Object-oriented plot

pyplot version

Plot lifecycle

Based on this great blog post by Chris Moffitt and the matplotlib tutorial that's based on the same post.

Reading in raw data of customer sales transactions and keeping sales volume and number of purchases for top 10 customers by sales.

Choosing a style

Prototyping plot with Pandas

Customising plot combining fast Pandas plotting with Matplotlib object-oriented API

Formatting currency values using custom formatter

Adding a line for average sales

Identify new customers

Show sales and number of purchases, xkcd-themed (just because...)