def n_subplots(ax_im):
 return len(ax_im.get_figure().get_axes())

def n_subplots ( ax_im ) : return len ( ax_im . get_figure ( ) . get_axes ( ) )
return the number of subplots in the figure containing an axesimage .