Pyplot isn't thread-safe. See e.g. https://github.com/matplotlib/matplotlib/issues/28611#issuecomment-3967630110.
Pyplot isn't thread-safe. See e.g. matplotlib/matplotlib#28611 (comment).