1x_axis_labels = [1,2,3,4,5,6,7,8,9,10,11,12] # labels for x-axis
2y_axis_labels = [11,22,33,44,55,66,77,88,99,101,111,121] # labels for y-axis
3
4# create seabvorn heatmap with required labels
5sns.heatmap(flights_df, xticklabels=x_axis_labels, yticklabels=y_axis_labels)
6
1# Basic syntax:
2sns.heatmap(df, xticklabels=x_labels, yticklabels=y_labels)
3
4# Example usage:
5import seaborn as sns
6flight = sns.load_dataset('flights') # Load flights datset from GitHub
7 # seaborn repository
8
9# Reshape flights dataeset to create seaborn heatmap
10flights_df = flight.pivot('month', 'year', 'passengers')
11
12x_labels = [1,2,3,4,5,6,7,8,9,10,11,12] # Labels for x-axis
13y_labels = [11,22,33,44,55,66,77,88,99,101,111,121] # Labels for y-axis
14
15# Create seaborn heatmap with required labels
16sns.heatmap(flights_df, xticklabels=x_labels, yticklabels=y_labels)