I need to visualize the folowing function (correlation function) that uses matplotlib in the Flask front end.
def correlation(dataframe):
correlation_matrix = dataframe.corr()
axes_heatmap = plt.axes()
sns.heatmap(correlation_matrix, ax = axes_heatmap)
axes_heatmap.set_title('Correlation Matrix')
plt.plot(sns)
visualization(dataframe,highest_correlated_list) #A list of some features will be given so that they will be visualized in scatter plot.
return 'visualized successfully'
def visualization(dataframe,dataframe_list):
try:
for i in range(len(dataframe_list)):
x = dataframe_list[i][0]
y = dataframe_list[i][1]
plotdata = sns.pairplot(dataframe, x_vars = [x], y_vars = [y])
title = str(x) +' VS ' + str(y)
plotdata.fig.suptitle(title, y = 1)
plt.show()
except:
dataframe.plot()
Is there any way in Flask python front end to show the images from the above function? If so, could anyone help me out here? I checked some answers in stack overflow but I cannot achieve my requirement.