I'd combine this with the line above: ``Z = np.sort(np.hstack(samples))``.