I want to create a plot consisting of several subplots with shared x/y axes.
It should look something like this from the documentation (though my subplots will be scatterblots): (code here)

But I want to create the subplots dynamically!
So the number of subplots depends on the output of a previous function. (It will probably be around 3 to 15 subplots per diagram, each from a distinct dataset, depending on the input of my script.)
Can anyone tell me how to accomplish that?
This code works but you will need to correct the axes. I used to
subplotto plot 3 graphs all in the same column. All you need to do is assign an integer tonumber_of_plotsvariable. If the X and Y values are different for each plot you will need to assign them for each plot.subplotworks as follows, if for example I had a subplot values of3,1,1. This creates a 3×1 grid and places the plot in the 1st position. In the next interation if mysubplotvalues were3,1,2it again creates a 3×1 grid but places the plot in the 2nd position and so forth.