Python 在jupyter覆盖两块海生地块

Python 在jupyter覆盖两块海生地块,python,matplotlib,jupyter-notebook,data-visualization,seaborn,Python,Matplotlib,Jupyter Notebook,Data Visualization,Seaborn,我正试图在jupyter笔记本上覆盖2个seaborn Distplot。如果我使用普通的pythonshell,但不使用Jupyter,则此代码可以工作。我只得到一张图。第二个图形不显示 import seaborn as sns import matplotlib.pyplot as plt from IPython.display import display %matplotlib inline sns.set() sns.distplot(x['wr'], kde=False, lab

我正试图在jupyter笔记本上覆盖2个seaborn Distplot。如果我使用普通的pythonshell,但不使用Jupyter,则此代码可以工作。我只得到一张图。第二个图形不显示

import seaborn as sns
import matplotlib.pyplot as plt
from IPython.display import display
%matplotlib inline
sns.set()
sns.distplot(x['wr'], kde=False, label='16-4', hist_kws={"alpha": 0.2})
sns.distplot(y['wr'], kde=False, label='17-4', hist_kws={"alpha": 0.2})
plt.show()

请不要建议使用
hue
参数。

我已经测试过这对我的样本数据有效:

ax = sns.distplot(x['wr'], kde=False, label='16-4', hist_kws={"alpha": 0.2})
sns.distplot(y['wr'], kde=False, label='17-4', hist_kws={"alpha": 0.2}, ax=ax)
#                                                                       ^^^^^

但是,实际上,我的代码使用或不使用
ax=ax
;所以我很想知道它是否对你有用。

它怎么不起作用?你得到了什么?更新了问题。是的,没有斧头对我有用。我的jupyter主题有一些问题。必须将其重置为默认值,然后才能正常工作。