def heatmap(df, z_score=None, title='<STR_LIT>', figsize=(<NUM_LIT:5>,<NUM_LIT:5>), cmap='<STR_LIT>', <EOL>xticklabels=True, yticklabels=True, ofname=None, **kwargs):
df = zscore(df, axis=z_score)<EOL>df = df.iloc[::-<NUM_LIT:1>]<EOL>ny, nx = df.shape<EOL>xticks = np.arange(<NUM_LIT:0>, nx, <NUM_LIT:1>) + <NUM_LIT><EOL>yticks = np.arange(<NUM_LIT:0>, ny, <NUM_LIT:1>) + <NUM_LIT><EOL>if hasattr(sys, '<STR_LIT>') and (ofname is None): <EOL><INDENT>fig = plt.figure(figsize=figsize)<EOL><DEDENT>else:<EOL><INDENT>fig = Figure(figsize=figsize)<EOL>canvas = FigureCanvas(fig)<EOL><DEDENT>ax = fig.add_subplot(<NUM_LIT>)<EOL>vmin = np.percentile(df.min(), <NUM_LIT:2>)<EOL>vmax =  np.percentile(df.max(), <NUM_LIT>)<EOL>matrix = ax.pcolormesh(df.values, cmap=cmap, vmin=vmin, vmax=vmax)<EOL>ax.set_ylim([<NUM_LIT:0>,len(df)])<EOL>ax.set(xticks=xticks, yticks=yticks)<EOL>ax.set_xticklabels(df.columns.values if xticklabels else '<STR_LIT>', fontsize=<NUM_LIT>, rotation=<NUM_LIT>)<EOL>ax.set_yticklabels(df.index.values if yticklabels else '<STR_LIT>',  fontsize=<NUM_LIT>)<EOL>ax.set_title("<STR_LIT>"%title, fontsize=<NUM_LIT:20>)<EOL>ax.tick_params(axis='<STR_LIT>', which='<STR_LIT>', bottom=False, top=False,<EOL>right=False, left=False)<EOL>cbar = colorbar(matrix)<EOL>cbar.ax.tick_params(axis='<STR_LIT>', which='<STR_LIT>', bottom=False, top=False,<EOL>right=False, left=False)<EOL>for side in ["<STR_LIT>", "<STR_LIT:right>", "<STR_LIT:left>", "<STR_LIT>"]:<EOL><INDENT>ax.spines[side].set_visible(False)<EOL>cbar.ax.spines[side].set_visible(False)<EOL><DEDENT>if ofname is not None: <EOL><INDENT>fig.savefig(ofname, bbox_inches='<STR_LIT>', dpi=<NUM_LIT>)<EOL><DEDENT>return<EOL>
Visualize the dataframe.

    :param df: DataFrame from expression table.
    :param z_score: z_score axis{0, 1}. If None, don't normalize data.
    :param title: gene set name.
    :param outdir: path to save heatmap.
    :param figsize: heatmap figsize.
    :param cmap: matplotlib colormap.
    :param ofname: output file name. If None, don't save figure