📜  图片作为seaborn plot python代码示例的背景

📅  最后修改于: 2022-03-11 14:45:46.407000             🧑  作者: Mango

代码示例1
import matplotlib.image as mpimg 
img = mpimg.imread("black.png")

import seaborn as sns
plot = sns.distplot(df['Rating'], hist=True, kde=True, 
             bins=int(15), color = 'darkblue', 
             hist_kws={'edgecolor':'black'},
             kde_kws={'linewidth': 3})
plot.imshow(img,
          aspect = plot.get_aspect(),
          extent = plot.get_xlim() + plot.get_ylim(),
          zorder = 0.5)