Annotated Heatmaps using Plotly in Python
A Plotly is a Python library that is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot, and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library.
Annotated Heatmaps is the most important component of the heatmap as they shows additional information that associates with rows or columns in the heatmap. Annotation heatmaps will be represented as rows of grids through which multiple metrics can be compared to others.
Syntax: create_annotated_heatmap(z, x=None, y=None, annotation_text=None, colorscale=’Plasma’, font_colors=None, showscale=False, reversescale=False)
x: x axis labels.
y: y axis labels.
z: z matrix to create heatmap.
annotation_text: Text strings for annotations. Should have the same dimensions as the z matrix. If no text is added, the values of the z matrix are annotated. Default = z matrix values.
colorscale: heatmap colorscale.
In plotly, colorscale or color chart is a flat physical object which have different types of colors. It can be set in this graph using the colorscale parameter.
Example 2: Adding Custom Colorscale
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course