简体   繁体   中英

How to make all cells in heatmap square

Hey I'm plotting a heatmap of a pandas dataframe but the cells on the top and bottom rows are not square / the same shape or size as the rest, see image. What am I missing?

sns.heatmap(mat, ax=ax, cmap=cmap, linewidths=.5, square=True)

在此处输入图片说明 Thanks!

Updating matplotlib fixed this issue. Apparently it was an issue with matplotlib 3.1.1 see https://github.com/mwaskom/seaborn/issues/1773

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM