Hel*_*lad 63 python matplotlib seaborn
我试图使用seaborn,因为它的distplot功能.但我更喜欢默认的matplotlib设置.当我导入seaborn时,它会自动改变我的身材的外观.
如何在不改变图形外观的情况下使用seaborn功能?
mwa*_*kom 79
版本0.0(2017年7月)改变了这种行为.来自https://seaborn.pydata.org/whatsnew.html:
导入seaborn时,不再应用默认(seaborn)样式.现在需要显式调用set()或set_style(),set_context()和set_palette()中的一个或多个.相应地,seaborn.apionly模块已被弃用.
对于旧版本,导入seaborn像这样:
import seaborn.apionly as sns
Run Code Online (Sandbox Code Playgroud)
然后你应该能够使用sns.distplot但保持默认的matplotlib样式+你的个人rc配置.
Ser*_*ity 20
根据文档reset_orig 将所有RC参数恢复为原始设置:
import seaborn as sns
# reset RC params to original
sns.reset_orig()
Run Code Online (Sandbox Code Playgroud)