How to increase the font size of the x and y axis for a heat map
Question:
How to increase the font size of the x and y axes for a heat map?
# Correlation between different variables
corr = data_set.corr()
#
# Set up the matplotlib plot configuration
#
f, ax = plt.subplots(figsize=(40, 20))
#
# Configure a custom diverging colormap
#
cmap = sns.diverging_palette(230, 20, as_cmap=True)
#
# Draw the heatmap
sns.heatmap(corr, annot=True, cmap=cmap)
ax.set_title('Correlation Heat Map', weight='bold', fontsize = 25)
sns.set(font_scale=3)
plt.show()
Answers:
ax.set_xticklabels(ax.get_xticklabels(), fontsize=20)
ax.set_yticklabels(ax.get_yticklabels(), fontsize=20)
How to increase the font size of the x and y axes for a heat map?
# Correlation between different variables
corr = data_set.corr()
#
# Set up the matplotlib plot configuration
#
f, ax = plt.subplots(figsize=(40, 20))
#
# Configure a custom diverging colormap
#
cmap = sns.diverging_palette(230, 20, as_cmap=True)
#
# Draw the heatmap
sns.heatmap(corr, annot=True, cmap=cmap)
ax.set_title('Correlation Heat Map', weight='bold', fontsize = 25)
sns.set(font_scale=3)
plt.show()
ax.set_xticklabels(ax.get_xticklabels(), fontsize=20)
ax.set_yticklabels(ax.get_yticklabels(), fontsize=20)