I created a function that takes some inputs and creates a graph out of it. And now I want to return that subplot graph from the function which can be plotted later or used on the web page.
My function looks something like this (just a dummy representation)
def plot_g(x, y):
# subplots
fig, ax = plt.subplots(1, 2, figsize=(18, 14))
# bar
sns.barplot(x, y, ax= ax[0][0]
# pie
ax[0][1].pie(x,y)
I don't know what and how to do it, I also tried to follow this answer, but I am not able to understand and apply that here.