Is it possible to automatically generate multiple subplots in matplotlib?
问题 Is it possible to automatically generate multiple subplots in matplotlib? An example of the process I want to automate is: import matplotlib.pyplot as plt figure = plt.figure() ax1 = figure.add_subplot(2, 3, 1) ax2 = figure.add_subplot(2, 3, 2) ax3 = figure.add_subplot(2, 3, 3) ax4 = figure.add_subplot(2, 3, 4) ax5 = figure.add_subplot(2, 3, 5) ax6 = figure.add_subplot(2, 3, 6) The subplots need unique names, as this will allow me to do stuff like: for ax in [ax1, ax2, ax3, ax4, ax5, ax6]: ax