#7. Heatmap
#Heatmaps are used to visualize the correlation between different variables.
import seaborn as sns
import pandas as pd
# Example: Heatmap of correlations
data = {
'Sales': sales,
'Profit': profit,
'Products Sold': products_sold
}
df = pd.DataFrame(data)
correlation_matrix = df.corr()
sns.heatmap(correlation_matrix, annot=True, cmap='coolwarm')
plt.title("Correlation Heatmap")
plt.show()
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter