import seaborn as sns
flatui = ["#9b59b6", "#3498db"]
sns.palplot(flatui, size=3)
反正有没有在每个正方形上打印颜色值?
1 个答案:
答案 0 :(得分:0)
您可以先抓取轴对象,然后使用ax.text
import seaborn as sns
import matplotlib.pyplot as plt
flatui = ["#9b59b6", "#3498db"]
sns.palplot(flatui, size=3)
ax = plt.gca()
for i, name in enumerate(flatui):
ax.text(i, 0, name)