How to set plt figure's title?

def visfeaturemap(feature_maps, filename='default.png', save=False):
    # plot all 64 maps in an 8x8 squares
    square = 8
    ix = 1
    for _ in range(square):
        for _ in range(square):
            # specify subplot and turn of axis
            ax = plt.subplot(square, square, ix)
            ax.set_xticks([])
            ax.set_yticks([])
            # plot filter channel in grayscale
            plt.title(filename)
            plt.imshow(feature_maps[0, ix - 1, :, :].cpu().numpy(), cmap='gray')
            ix += 1

    plt.title(filename)
    plt.show()

    if save:
        plt.savefig(filename)

image

I want just one total figure title.
Plz help me^^.
Thank you.

I think you might be looking for plt.suptitle()

If you just want one title,why don’t you remove the plt.title(filename) within your loops?