%matplotlib inline
corr = df.corr()
f, ax = plt.subplots(figsize=(11, 9))
ax = sns.heatmap(
corr,
vmin=-1, vmax=1, center=0,
cmap=sns.diverging_palette(20, 220, n=500),
linewidths=.50,
cbar_kws={"shrink": .7},
square=True
)
ax.set_xticklabels(
ax.get_xticklabels(),
rotation=45,
horizontalalignment='right'
);
plt.show()
此代码不在azure数据块上显示任何绘图,仅显示
<Figure size 1100x900 with 2 Axes>
虽然相同的代码运行良好,并在前面显示了一个corr图,但不确定这里出了什么问题。 即使我尝试这个,我也会得到相同的输出
mask = np.triu(np.ones_like(corr, dtype=bool))
f, ax = plt.subplots(figsize=(11, 9))
cmap = sns.diverging_palette(20, 220, as_cmap=True)
sns.heatmap(corr, mask=mask, cmap=cmap, vmax=0.3, center=0,
square=True, linewidths=.1, cbar_kws={"shrink": .7})
plt.show()
上面的matplotlib模块似乎有问题
根据我们的测试,您将在上面的matplotlib模块中遇到以下错误消息
3.3.0
如果您已经在
3.3.0
上面安装了matplotlib模块,我建议您使用3.2.2
下面的matplotlib模块一旦您安装了
matplotlib==3.2.2
,我就能够成功地显示绘图相关问题 更多 >
编程相关推荐