Customizing heatmaps
Seaborn supports several types of additional customizations to improve the
output of a heatmap. For this exercise, we will continue to use the Daily Show data
that is stored in the df variable but we will customize the output.
Bu egzersiz, kursun bir parçasıdır
Intermediate Data Visualization with Seaborn
Egzersiz talimatları
- Create a crosstab table of
GroupandYEAR - Create a heatmap of the data using the
BuGnpalette - Disable the
cbarand increase thelinewidthto 0.3
Uygulamalı etkileşimli egzersiz
Bu egzersizi bu örnek kodu tamamlayarak deneyin.
# Create the crosstab DataFrame
pd_crosstab = pd.crosstab(df["Group"], df["____"])
# Plot a heatmap of the table with no color bar and using the BuGn palette
sns.heatmap(pd_crosstab, cbar=____, cmap="____", linewidths=____)
# Rotate tick marks for visibility
plt.yticks(rotation=0)
plt.xticks(rotation=90)
#Show the plot
plt.show()
plt.clf()