Visualizations Heat Map
Popup layout and format
The popup supports many customizations, including the text format, width, and disabling it entirely.
Sample data
Let's import PlotAPI and load our sample data.
from plotapi import HeatMap
matrix = [
[0, 5, 6, 4, 7, 4],
[5, 0, 5, 4, 6, 5],
[6, 5, 0, 4, 5, 5],
[4, 4, 4, 0, 5, 5],
[7, 6, 5, 5, 0, 4],
[4, 5, 5, 5, 4, 0],
]
row_names = ["Action", "Adventure", "Comedy", "Drama", "Fantasy", "Thriller"]
col_names = ["Action", "Adventure", "Comedy", "Drama", "Fantasy", "Thriller"]
Demonstration
Popup width
We can modify the popup width with the popup_width
parameter.
HeatMap(matrix, row_names=row_names, col_names=col_names, popup_width=100).show()
Disabling the popup
We can disable the popup with the popup_enabled
parameter.
HeatMap(matrix, row_names=row_names, col_names=col_names, popup_enabled=False).show()
Popup text format
We can change the noun, verb, and conjunction used in the popup text such that it is relevant for our visualisation. We can also remove them entirely and display names only.
The default looks like this (similar to Chord):
An example modification looks like this:
We can modify the popup text template with the conjunction
, verb
, and noun
parameters.
HeatMap(matrix, row_names=row_names, col_names=col_names,
conjunction="&", verb="appear together in", noun="cases").show()
Showing names only
We can show only the names in the popup with the popup_names_only
parameter.
HeatMap(matrix, row_names=row_names, col_names=col_names,
popup_names_only=True).show()