So I have this function that returns a regression plot (Axes object) using seaborn, and I want to place it in a pyplot figure where there are 4 axes spaces:
def plot_reg(self, cal_dict):
'''Function to plot the polynomial regression curve'''
regression_plot = sns.regplot(data = cal_dict,
x = cal_dict['x'],
y = cal_dict['y'],
ci = None,
line_kws = {"color" : 'red'},
order = 2
)
regression_plot.set_xlabel("x")
regression_plot.set_ylabel("y")
regression_plot.set_title(f'StackOverFlow')
return regression_plot
fig, ax = plt.subplots(2, 2)
ax[0][0] = plot_reg(cal_dict)
ax[0][1] = plot_reg(cal_dict2)
...
Is this possible?