Moved matplotlib code outside unittest purview