matplotlib/seaborn: first and last row cut in half of heatmap plot

前端 未结 11 1189
猫巷女王i
猫巷女王i 2020-11-21 13:35

When plotting heatmaps with seaborn (and correlation matrices with matplotlib) the first and the last row is cut in halve. This happens also when I run this minimal code exa

11条回答
  •  闹比i
    闹比i (楼主)
    2020-11-21 14:06

    I solved it by adding this line in my code, with matplotlib==3.1.1:

    ax.set_ylim(sorted(ax.get_xlim(), reverse=True))

    NB. The only reason this works is because the x-axis isn't changed, so use at your own risk with future mpl versions

提交回复
热议问题