- 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
Set Max value for color bar on Seaborn heatmap using Matplotlib
To set a value for color bar on Seaborn heatmap, we can take following Steps−
- Create random data using numpy.
- Use heatmap() method to plot rectangular data as a color-encoded matrix.
- To display the figure, use show() method.
Example
import numpy as np import seaborn as sns from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True data = np.random.rand(4, 4) ax = sns.heatmap(data, vmax=1) plt.show()
Output
- Related Articles
- Auto adjust font size in Seaborn heatmap using Matplotlib
- How to make a heatmap square in Seaborn FacetGrid using Matplotlib?
- How to add a legend on Seaborn facetgrid bar plot using Matplotlib?
- How to animate a Seaborn heatmap or correlation matrix(Matplotlib)?
- How to create a stacked bar chart for my DataFrame using Seaborn in Matplotlib?
- How to turn off error bars in Seaborn Bar Plot using Matplotlib?
- Setting Different Bar color in Matplotlib
- How to set the range of Y-axis for a Seaborn boxplot using Matplotlib?
- Adding value labels on a matplotlib bar chart
- How to color a Seaborn boxplot based on DataFrame column name in Matplotlib?
- Plotting a heatmap for 3 columns in Python with Seaborn
- How to remove the axis tick marks on a Seaborn heatmap?
- Adding units to heatmap annotation in Seaborn
- How to Set Color of Progress Bar using HTML and CSS?
- Using Colormaps to set the color of line in Matplotlib

Advertisements