Scope issues with __main__. That's what I get for not knowing Python.

Multiple plots on a single figure also fixed.