See https://github.com/matplotlib/matplotlib/issues/6696#issuecomment-230764472 That should prevent/ help with a lot of issues.