A heatmap is a plot of rectangular data as a color-encoded matrix. As parameter it takes a 2D dataset. That dataset can be coerced into an ndarray.
This is a great way to visualize data, because it can show the relation between variabels including time. For instance, the number of fligths through the years.
Related course: Matplotlib Examples and Video Course
heatmap example
heatmap
The heatmap plot below is based on random values generated by numpy. Many parameters are possible, this just shows the most basic plot.
1 | import pandas as pd |
heatmap colors
The heatmap colors plot below uses random data again. This time it’s using a different color map (cmap), with the ‘Blues’ palette which as nothing but colors of bue. It also uses square blocks.
1 | import pandas as pd |
heatmap data
The heatmap data plot is similar, but uses a different color palette. It uses the airline or flights dataset that’s included in seaborn.
1 | import pandas as pd |
If you are new to matplotlib, then I highly recommend this course.