import numpy import pylab def dispims_color(M, border=0, bordercolor=[0.0, 0.0, 0.0], *imshow_args, **imshow_keyargs): """ Display an array of rgb images. The input array is assumed to have the shape numimages x numpixelsY x numpixelsX x 3 """ bordercolor = numpy.array(bordercolor)[None, None, :] numimages = len(M) M = M.copy() for i in range(M.shape[0]): M[i] -= M[i].flatten().min() M[i] /= M[i].flatten().max() height, width, three = M[0].shape assert three == 3 n0 = numpy.int(numpy.ceil(numpy.sqrt(numimages))) n1 = numpy.int(numpy.ceil(numpy.sqrt(numimages))) im = numpy.array(bordercolor)*numpy.ones( ((height+border)*n1+border,(width+border)*n0+border, 1),dtype='