import matplotlib.pyplot as plt
import numpy as np
n_rows = 2
n_cols = 1
fig,axes = plt.subplots(n_rows,n_cols)
for row_num in range(n_rows):
for col_num in range(n_cols):
ax= axes [row_num][col_num]
ax.plot(np.random.rand(20))
ax.set_title(f'Plot {row_num+1}),{col_num+1})')
fig.suptitle('Main title')
fig.tight_layout()
plt.show()this should work perfectly clearly, but it gives an error
Axes' object is not subscriptable" Can you help me in finding answear?
I expect to know why it does not work, and how I can answer that. Also if this could be caused by different python versions?