Histogram Plots
In this lesson, histogram plots with matplotlib and seaborn are discussed.
We'll cover the following...
Histogram
This visualization is used to display the distribution of numerical data as accurately as possible. This plot divides the data into a specified number of bins, thus separating the data into a range of values. Then, it sketches bars to show the number of data points that each bin contains.
Using matplotlib
Matplotlib provides the hist()
function to plot a histogram. The following example implements a histogram of two-hundred random values.
Press + to interact
import numpy as npimport matplotlib.pyplot as pltset1 = np.random.randn(200) # Generating random dataplt.hist(set1, edgecolor='black', color='red', bins=20) # plotting histogram
Two ...