如何用 seaborn 制作多个地块?

How to make several plots with seaborn?

我想要的:
我想使用一个函数绘制大约 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))

在对visualise_univariate_feature一无所知的情况下,不可能给出明确的答案。

无论如何你都可以尝试

for i, feature in enumerate(features):
    plt.figure(i+1)
    display(visualise_univariate_feature(x=feature))