As title says, I am struggling to plot two plots together, side by side. Conceptually, the code is the following:
def my_func(arr):
plt.scatter(arr[:, 0], arr[:, 1])
fig, ax = plt.subplots(1, 2, sharex='col', sharey='row')
arr1 = np.array([[1, 2], [2, 2], [4, 3], [6, 4], [5, 6]])
for i in range(2):
my_func(arr1 + i)
The issue here is to plot two plots together using my_func - a function that creates a plot (using multiple parameters, so it is should to be a separate function). The problem here is that two plots that were supposed to be plotted in two different boxes are plotted in the same box. How to fix it?