#5, First Floor, 4th Street , Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to plot heat maps in python?
Description

To plot heap maps for input variables using python.

Process

   Import libraries.

  Heat maps one of the advanced for data visualization in python.

  Take sample data (Rows and columns).

  Define rows and columns according to our data set.

  Use plt.pcolor() to plot heat maps diagram.

Sapmle Code

#import libraries
import matplotlib.pyplot as plt
import pandas as pd

#take sample
data=[{650.5,553.2,619},{789,845.2,598},{650.5,553.2,619},{598,732.8,722.2},{553.2,619,789}]
print(“Data\n”,data)
#define how many rows
Index= [‘I1’, ‘I2′,’I3′,’I4′,’I5’]

#define how many columns
Cols = [‘C1’, ‘C2’, ‘C3’]
#create data frame
df = pd.DataFrame(data, index=Index, columns=Cols)

#plot the diagram
plt.pcolor(df)
plt.show()

Screenshots