I have 200 products and I want to plot time vs parameter graph. I have come up with a code that plots graphs for 20 products and displays them in one window.
I would like to know if there is a way to plot 200 graphs as subplots in 10 different windows, with each window containing 20 graphs each.
My Code
grouped = dataset.groupby('product_number')
ncols = 4
nrows = int(np.ceil(grouped.ngroups/40))
fig, axes = plt.subplots(figsize=(12,4), nrows = nrows, ncols = ncols)
for (key, ax) in zip(grouped.groups.keys(), axes.flatten()):
grouped.get_group(key).plot(x='TimeElapsed', y='StepID', ax=ax, sharex = True, sharey = True)
ax.set_title('product_number=%d'%key)
ax.legend()
plt.show()
This code gives me a window containing 20 subplots, as shown below
