In my code the user should be able to change the amount of subplots in the figure. So first there are two subplots:
I use following code:
ax1 = figure.add_sublots(2,1,1)
ax2 = figure.add_sublots(2,1,2)
If the plus button is pressed one subplot shall be added:
How should I do this? Is there a command like
ax1.change_subplot(3,1,1)
ax2.change_subplot(3,1,2)
ax3 = figure.add_sublots(3,1,3)
or do I have to delete all subplots and redraw them (which I would like to avoid)?
The command I was looking for is:
ax1.change_geometry(3,1,1)
With this command it is possible to rearrange the sublots. I found this solution here: Dynamically add subplots in matplotlib with more than one column