How can I use seaborn without changing the matplotlib defaults?
我正在尝试使用seaborn,因为它具有distplot功能。 但是我更喜欢默认的matplotlib设置。 导入seaborn时,它会自动更改图形的外观。
如何在不改变地块外观的情况下使用seaborn函数?
0.8版(2017年7月)更改了此行为。 来自https://seaborn.pydata.org/whatsnew.html:
The default (seaborn) style is no longer applied when seaborn is
imported. It is now necessary to explicitly call set() or one or more
of set_style(), set_context(), and set_palette(). Correspondingly, the
seaborn.apionly module has been deprecated.
对于较旧的版本,请按以下方式导入seaborn:
1 | import seaborn.apionly as sns |
然后您应该能够使用
根据文档
1 2 3 | import seaborn as sns # reset RC params to original sns.reset_orig() |