How to Plot Numpy Array in Seaborn

You can plot the NumPy array in Seaborn with the following code. The given example helps you to understand how to plot the NumPy array in Seaborn. I highly recommend you “Python Crash Course Book” to learn Python.

Example: Plot the NumPy array

# Import the required libraries
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt

# Create NumPy Array
data = np.random.randint(5, size=(7,5))

# Create Heatmap
sns.heatmap(data)

# Display the plot
plt.show()

Output:

Leave a Comment

Your email address will not be published.