What I want:
I want to plot around 8 density(violin) plots(all in separate graphs) using a function, however when I run I get either a single plot with all 8 features or 8 different plots of the same feature.
How to plot different plots on different graphs using a function?
My current codes:
#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))