Example 1: print the heat map python
import numpy as np
import seaborn as sns
import matplotlib.pylab as plt
uniform_data = np.random.rand(10, 12)
ax = sns.heatmap(uniform_data, linewidth=0.5)
plt.show()
Example 2: show integer seabron heatmap values
sns.heatmap(table2,annot=True,cmap='Blues', fmt='g')
Example 3: matplotlib heatmap
import numpy as np
import matplotlib.pyplot as plt
data = np.random.random(( 12 , 12 ))
plt.imshow( data , cmap = 'autumn' , interpolation = 'nearest' )
plt.title( "2-D Heat Map" )
plt.show()
Example 4: python add labels to seaborn heatmap
sns.heatmap(df, xticklabels=x_labels, yticklabels=y_labels)
import seaborn as sns
flight = sns.load_dataset('flights')
flights_df = flight.pivot('month', 'year', 'passengers')
x_labels = [1,2,3,4,5,6,7,8,9,10,11,12]
y_labels = [11,22,33,44,55,66,77,88,99,101,111,121]
sns.heatmap(flights_df, xticklabels=x_labels, yticklabels=y_labels)
Example 5: python plot heatmap by city