-1

Hello How I can increase the x, y tick label font size in seaborn heatmap subplots? I wanna have pretty good balanced label and title size between subplots My current coding is like the below.

fig, axes = plt.subplots(nrows=1, ncols=3, figsize=(20,7)) 

# Singular office 
A = sns.heatmap(data =corr_CO2_R_VC_SingularOffice, ax=axes[0], mask=mask4, cmap=cmap, vmax=1.0, vmin=-0.3, center=0,
            square=True, linewidths=.5, cbar_kws={"shrink": .5}
           , annot=True, cbar = False, fmt=".1f",annot_kws={"size": 14})

# Openplan office 
B = sns.heatmap(corr_CO2_R_VC_OpenplanOffice, ax=axes[1], mask=mask5, cmap=cmap, vmax=1.0, vmin=-0.3, center=0,
            square=True, linewidths=.5, cbar_kws={"shrink": .5}
           , annot=True,  cbar = False, fmt=".1f",annot_kws={"size": 14})

# MultiR
C = sns.heatmap(corr_CO2_R_VC_MultiR, ax=axes[2], mask=mask6, cmap=cmap, vmax=1.0, vmin=-0.3, center=0,
            square=True, linewidths=.5, cbar_kws={"shrink": .5}
           , annot=True, fmt=".1f",annot_kws={"size": 14})

# Spacing
plt.subplots_adjust(left= 0.11, bottom=0.35, right=0.9, top=0.7, wspace=0.1, hspace=0.1)

#xtick label name change
A.set_yticklabels(['People_count','VC_singularoffice','Wall','Desk','Entrance']) 
A.set_xticklabels(['People_count','VC_singularoffice','Wall','Desk','Entrance']) 

B.set_yticklabels(['People_count','VC_openplanoffice','Wall','Desk','Entracne']) 
B.set_xticklabels(['People_count','VC_openplanoffice','Wall','Desk','Entracne']) 

C.set_yticklabels(['People_count','VC_MultiR','Wall','Desk','Entrance']) 
C.set_xticklabels(['People_count','VC_MultiR','Wall','Desk','Entrance']) 


#common title
fig.suptitle('CO2 & Occupancy', fontsize = 18)

#sub title 
A.set_title("Singular office", fontsize=16)
B.set_title("Openplan office ", fontsize=16)
C.set_title("MultiR", fontsize=16)

plt.tight_layout()

plt.show()

x, ytick label size is too small

Yunni
  • 15
  • 2

1 Answers1

-1

Have you tried this possible solution out?

e.g.:

A.set_yticklabels(A.get_yticks(), size = 15)
Timothy
  • 143
  • 3
  • 12