What import matplotlib.pyplot as plt does, how to check your install, and how to fix figures that do not appear or imports that fail. For research workflows, that means one import line serves ...
这里的重点提醒是:源码包的Python代码主体不在根目录的 matplotlib 下,而是集中在 lib/matplotlib 。3.7.0采用标准源码布局, mpl-data 也在 lib 之内。熟悉这个结构之后,后面改字体、改默认线宽、替换样式表都会省很多查找时间。