1

I created a seaborn heatmap using the code below, but it does not seem to fit properly. Any ideas on where the code might be going wrong?

ax = sns.heatmap(cm, linewidths=.2, linecolor='gray', cmap=sns.cubehelix_palette(light=1, as_cmap=True),
                 annot=True, fmt=fmt, vmin=0.0, vmax=vmax, square=True)

ax.set_xlabel(xlabel)
ax.set_ylabel(ylabel)
ax.set_title(title)
ax.set_yticklabels([x for x in ticks][::-1], rotation=0, size=9)
ax.set_xticklabels([x for x in ticks], rotation=0, size=9)

plt.tight_layout()
plt.savefig(dir_out + os.sep + fname, dpi=cc.DPI)
plt.close()

ap not showing up

user308827
  • 21,227
  • 87
  • 254
  • 417
  • 3
    This is a bug with the latest version of matplotlib. Try downgrading to version `3.1.0`. [See here](https://github.com/matplotlib/matplotlib/issues/14675) – Chris Adams Nov 29 '19 at 09:29
  • as a workaround, you can set heatmap limits (ylim) manualy using `ax.set_ylim` refer [here](https://stackoverflow.com/questions/56942670/matplotlib-seaborn-first-and-last-row-cut-in-half-of-heatmap-plot) – Shijith Nov 29 '19 at 09:42

0 Answers0