I wanted to change the font size for a heatmap colorbar.
The following is my code:
import seaborn as sns
import matplotlib.pyplot as plt
from numpy import arange
x = arange(25).reshape(5, 5)
cmap = sns.diverging_palette(220, 20, sep=20, as_cmap=True)
ax = sns.heatmap(x, cmap=cmap)
plt.show()
I was able to change the tick labels with plt.tick_params(axis='both', labelsize=20)
. However, the colorbar font size does not change.
Is there a way to do that?
所有评论(0)