pull out pyplot functions from invest/models.py and invest/util.py