在 python 脚本中导入 seaborn 搞乱了情节风格

Importing seaborn in python script messing up plot style

下面附上两张图。生成它们的脚本的唯一区别是第二个脚本有一个额外的行:

import seaborn as sns

我还没有设置任何 seaborn 样式。只是导入 seaborn 正在改变情节风格,即使在不使用 seaborn 的情节中也是如此。有什么办法可以导入 seaborn(用于其他地块),并且不更改不使用它的地块的样式?

检查这个

import seaborn.apionly as sns or from seaborn.apionly import lmplot

http://stanford.edu/~mwaskom/software/seaborn/whatsnew.html