# 그림용 데이터 프레임 생성
tmp = pd.DataFrame({'팔렛트만들기':list(range(38))})
tmp = tmp.T
# 사용할 팔렛트 불러오기
cmap = matplotlib.colors.LinearSegmentedColormap.from_list("", ['#cc3300','#ff9966','#ffcc00','#99cc33','#339900'])
# 그림그리기
plt.figure(figsize=(15,1))
ax = sns.heatmap(tmp, cmap=cmap, linewidths=1, linecolor='white')
colorbar = ax.collections[0].colorbar
ax.set_xticklabels([])
plt.show()
'Informations > python' 카테고리의 다른 글
python에서 특정 폴더에 존재하는 txt파일 가져오기 (0) | 2023.06.23 |
---|---|
python, Jupyter notebook 한글 깨짐 해결, figure 한글 쓰기 (0) | 2023.06.23 |
matplotlib cmap 뒤집기 cmap.reversed() (0) | 2023.06.23 |