小编Flo*_*ops的帖子

matplotlib / seaborn:将第一行和最后一行切成热图图的一半

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 example which I found online.

import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

data = pd.read_csv('https://raw.githubusercontent.com/resbaz/r-novice-gapminder-files/master/data/gapminder-FiveYearData.csv')
plt.figure(figsize=(10,5))
sns.heatmap(data.corr())
plt.show()
Run Code Online (Sandbox Code Playgroud)

并获得此结果(目前还不允许我嵌入图像) The labels at the y axis are on the correct spot, but the rows aren't completely there.

A few days ago, it work as intended. Since then, I …

python matplotlib seaborn

59
推荐指数
4
解决办法
7877
查看次数

标签 统计

matplotlib ×1

python ×1

seaborn ×1