当我制作一个将 shade 参数设置为 True 的 seaborn.kdeplot 时,背景是白色的。如果在更宽的范围(此处为蓝线)上绘制了其他内容,则此背景不会扩展到整个图。如何让 kdeplot “扩展到”整个情节?
(最终,让 kdeplot 的第一个阴影是透明的也可以解决问题)
这个例子:
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
plt.plot([-3, 3],[0,60])
points = np.random.multivariate_normal([0, 0], [[1, 2], [2, 20]], size=1000)
sns.kdeplot(points, shade=True)
plt.show()