Add matplotlib to requirements.txt and fix TypeError in setup