Answers for "seaborn heatmap cmap"

1

seaborn heatmap parameters

# seaborn heatmap best parameter
plt.figure(figsize=(20,8))
sns.heatmap(corr, vmax=1, vmin=-1, center=0,
			linewidth=.5,square=True, annot = True,
            annot_kws = {'size':8},fmt='.1f', cmap='BrBG_r', ax=ax1,  # ax: use this when using subplot
            cbar_kws = dict(use_gridspec=False,location="top", shrink=0.9)) # cbar_kws: for positioning cbar and "shrink" for reducing cbar size
plt.title('Correlation')
plt.show()
Posted by: Guest on August-23-2021

Python Answers by Framework

Browse Popular Code Answers by Language