- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to make a heatmap square in Seaborn FacetGrid using Matplotlib?
To make a heatmap square in Seaborn facetgrid, we cn use heatmap() method with 10×10 random data set.
Steps
Create a random data of size 10×10, with minimum -1 and maximum 10.
Plot rectangular data as a color-encoded matrix using heatmap() method with data and color map "twilight_r".
To display the figure, use show() method.
Example
import numpy as np import seaborn as sn import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True data = np.random.randint(low=-1, high=10, size=(10, 10)) hm = sn.heatmap(data=data, cmap="twilight_r") plt.show()
Output
- Related Articles
- How to add a legend on Seaborn facetgrid bar plot using Matplotlib?
- Plotting error bars from a dataframe using Seaborn FacetGrid (Matplotlib)
- Auto adjust font size in Seaborn heatmap using Matplotlib
- How to make custom grid lines in Seaborn heatmap?
- How to animate a Seaborn heatmap or correlation matrix(Matplotlib)?
- Set Max value for color bar on Seaborn heatmap using Matplotlib
- How to add text in a heatmap cell annotations using seaborn in Python?
- How to create a seaborn correlation heatmap in Python?
- How to create a Triangle Correlation Heatmap in seaborn?
- How to annotate each cell of a heatmap in Seaborn?
- How to hide the colorbar of a Seaborn heatmap?
- How to plot a non-square Seaborn jointplot or JointGrid? (Matplotlib)
- Adding units to heatmap annotation in Seaborn
- How can FacetGrid be used to visualize data in Python Seaborn Library?
- How to annotate a heatmap with text in Matplotlib?

Advertisements