【发布时间】:2020-05-28 02:32:49
【问题描述】:
我从一个上三角 numpy 数组制作 Seaborn 热图。
import seaborn as sns, numpy as np
a = np.random.random((20, 20))
mask = np.zeros_like(a)
mask[np.tril_indices_from(mask)] = True #mask the lower triangle
with sns.axes_style("white"): #make the plot
ax = sns.heatmap(a, xticklabels=False, yticklabels=False, mask=mask, square=False, cmap="YlOrRd")
plt.show()
我想将绘图顺时针旋转 135 度。如果解决方案不使用 Seaborn,我也会很高兴
【问题讨论】:
-
“将绘图顺时针旋转 135 度”是什么意思?它会是什么样子?
-
我认为这是一个完美的解释性陈述
-
在绘制选项之前旋转数据吗?当然,这会裁剪一些边距,因为最终的热图将是矩形的。
-
当然,是的,之前旋转没问题
标签: python matplotlib seaborn