exerimental: displaying text on the heatmap

def make_heatmap(self, unstacked_df, singleletters):

        fig, ax = plt.subplots(num=None, figsize=(10,len(unstacked_df)/3), dpi=80, facecolor='w', edgecolor='k')


        #heatmap = ax.pcolor(unstacked_df, cmap=plt.cm.Reds, alpha=2, vmax = 5)
        #heatmap = ax.pcolor(unstacked_df, cmap=plt.cm.gist_ncar_r, alpha=20, vmax = 20)
        #heatmap = ax.pcolor(unstacked_df, cmap=plt.cm.YlGnBu, alpha=20, vmax = 2)
        heatmap = ax.pcolor(unstacked_df, cmap=plt.cm.jet, alpha=10, vmax = 5)

       # ax.set_title('140616 - Esp distribution in actinobacteria')

        #cb = plt.colorbar(heatmap)
        #cb.set_label('# of copies')

        species_names_only = ['%s locus:%s' % (x[0],str(x[1])[-12:]) for x in unstacked_df.index.values]

        ax.set_aspect('equal')
        ax.yaxis.set_ticks(range(0, len(unstacked_df.values)))
        ax.xaxis.set_ticks(range(0, len(unstacked_df.columns)))
        ax.set_xticklabels(unstacked_df.columns, rotation='90')
        ax.set_yticklabels(species_names_only)
        #ax.set_yticklabels(unstacked_df.index.values)
        ax.tick_params(axis='both', left='off', right='off', bottom='off', top='off')
        #ax.set_xticks(np.range(data.shape[0])+0.5, minor=False)
        #ax.set_yticks(np.range(data.shape[1])+0.5, minor=False)
        #ax.invert_yaxis()
        #ax.xaxis.tick_top()

        plt.grid(True, color='black', ls='-', linewidth=0.5)

        '''exerimental: displaying text on the heatmap'''

        if singleletters != None:

            for y in range(unstacked_df.values.shape[0]):
                for x in range(unstacked_df.values.shape[1]):
                    plt.text(x + 0.5, y + 0.5, '%.4s' % singleletters[(x)],
                             horizontalalignment='center',
                             verticalalignment='center',
                             )  
        plt.savefig("out.svg")
        plt.show()