为什么seaborn.axes_style在Jupyter上重置?

问题描述 投票:0回答:1

[当我在Jupyter笔记本中首次使用seaborn.set()时,seaborn.axes_style()['figure.facecolor']被设置为预期的“白色”,但是该值在下一个单元格中被重置。为什么?

Python 3.7.3,IPython 7.5.0,seaborn 0.9.0

[当我在新的Jupyter笔记本中运行以下代码时,我得到了这些输出,对我来说这没有意义:

单元格1]]

import seaborn
seaborn.set()
print(seaborn.axes_style()['figure.facecolor'])
print(seaborn.axes_style()['figure.facecolor'])

出1:

    white
    white

单元2:

print(seaborn.axes_style()['figure.facecolor'])

出2:

    (1, 1, 1, 0)

单元3:

seaborn.set()
print(seaborn.axes_style()['figure.facecolor'])

出3:

    white

单元格4:

print(seaborn.axes_style()['figure.facecolor'])

出4:

    white

我想念什么?

实际的matplotlib图受此影响,我需要摆脱它。

[此外,由于我想每次执行set(),因此我尝试将其放入~/.ipython/profile_default/startup/00.py,但没有用。我该如何实现?

[当我第一次在Jupyter笔记本中使用seaborn.set()时,seaborn.axes_style()['figure.facecolor']设置为预期的“白色”,但是该值在下一个单元格中被重置。为什么? Python 3.7.3,...

python jupyter seaborn
1个回答
0
投票

自我回答:

© www.soinside.com 2019 - 2024. All rights reserved.