Book Review: Matplotlib for Python Developers

Matplotlib for Python Developers by Sandro Tosi is the latest in a
series of concise project-specific manuals from Packt. It covers
the matplotlib library for creating charts and graphs.

Quick Review

My review for the impatient reader:

Why I picked it up: I thought it might help with a project at work.

Why I finished it: I wanted to see what features matplotlib had
the could be useful, and how to integrate it with web frameworks.

I’d give it to: Anyone wishing to create custom charts and graphs,
especially pragmatically.

Review

The book starts a little slowly, presenting lots of background
material and feature lists in chapter 1 without any real examples to
make them concrete. Chapter 1 also covers the installation process.
It’s a shame binary installers are required, and it isn’t clear
matplotlib and its dependencies work with tools like virtualenv. I
wish more publishers would move the installation instructions in these
sorts of books out of the first chapter and into an appendix, and let
the main content of the book focus on the primary subject matter.

The examples in chapters 2-4 start simple and build in complexity,
adding feature after feature. The progression is logical and it is
easy to skim over the repetitious parts of subsequent examples.
Having each chart style and annotation feature described will make the
book a good reference guide for someone using the library.

There were two minor issues with the presentation of the examples,
though. First, the author’s use of the non-standard IPython UI was a
little distracting, but it was explained in a later chapter that there
are some special interactive features of matplotlib which are best
used together with IPython. Second, the examples frequently use
“import as” to create abbreviated forms of module names. While it made
the code samples smaller, and may be how experienced matplotlib users
work, as a new user I found that it made the examples harder to
follow because I could not always tell where the functions were coming
from.

The second half of the book includes three separate chapters covering
integration of matplotlib with different GUI toolkits, which felt a
little excessive. Since the same example application is presented, it
would have been less repetitious to see the chapters combined with
only the difference highlighted. The same comment applies to the three
sections on using matplotlib on the web. Using just one of the three
tools (CGI, Django, or Pylons) would have been sufficient, and left
space for more advanced examples or a deeper explanation.

Conclusions

My overall impression of the book is that it could make a useful
reference guide for matplotlib, but it didn’t have a lot of advice for
visualization issues in general. There are other more general books on
visualization techniques (including one from Packt), so the narrow
focus isn’t necessarily a problem if you are willing to look further.

Disclaimer: I received a free review copy of this book from the
publisher as part of my participation in the PyATL Book Club.