我想绘制两个不同的密度图,一个在同一个图表上,同一个轴上。
这是我试过的代码:
# setting the dimensions of the plot
fig, ax = plt.subplots(figsize=(16, 9))
# drawing the plot
sns.displot(np.random.randint(25,size=500), kind = "kde")
sns.displot(np.random.randint(25,size=500), kind = "kde")
我只得到最后一次抽奖,但没有达到我想要的大小。
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
fig = sns.kdeplot(np.random.randint(25,size=500), shade=True, color="r")
fig = sns.kdeplot(np.random.randint(25,size=500), shade=True, color="b")
plt.show()