matplotlib minor refactorings