如何与seaborn一起制作几部剧情片?

2024-06-07 01:14:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我想要的:
我想用一个函数绘制大约8个密度(小提琴)曲线图(都在单独的图形中),但是当我运行时,我得到的要么是一个包含所有8个特征的单一绘图,要么是具有相同特征的8个不同绘图。
如何使用函数在不同的图形上绘制不同的图?在

我的当前代码:

#CODE-1

#feature: a list of 8 features that i want to visualise
#visualise_univariate_feature: a function that plots a seaborn violin plot
#this code produces 8 plots but all on the same feature from the list(the last element of the list)

for i in range(9):
plt.figure(i)
for feature in features:
    display(visualise_univariate_feature(x=feature))

#CODE-2 

#This code produces 1 plot with 8 features all together
for feature in features:
   display(visualise_univariate_feature(x=feature))

Tags: ofthe函数in图形绘图forvisualise