Move code into new python module, automate plotting, and improve color portraits