Seaborn Histogram

Seaborn Histograms

A histogram represents the distribution of data by forming bins along the data range and plotting a bar chart to show the number of observations in each bin.

Seaborn comes with several datasets, some of which we’ve already used in previous chapters. We’ve also learned how to load datasets and query the list of available datasets.

Seaborn comes with several datasets, some of which we’ve already used in previous chapters. We’ve also learned how to load datasets and query the list of available datasets.

Examples

import pandas as pd
import seaborn as sb
from matplotlib import pyplot as plt
df = sb.load_dataset('iris')
sb.distplot(df['petal_length'],kde = False)
plt.show()

Output

Seaborn - Histogram

Here, the kde flag is set to False. Therefore, the representation of the kernel estimate graph is removed and only the histogram is plotted.

Leave a Reply

Your email address will not be published. Required fields are marked *