From the course: Python Functions for Data Science

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Matplotlib histograms

Matplotlib histograms - Python Tutorial

From the course: Python Functions for Data Science

Start my 1-month free trial

Matplotlib histograms

- [Instructor] The histogram is commonly used to visualize the distribution of quantitative data. In this video, I'll be showing you how to create a histogram using Matplotlib's functions. Let's say that I have a Panda series containing students' grades on exam number one in a particular course, and I stored it in a variable named exam one grades. I've displayed the first few values in exam one grades here. Now say I want to create a histogram to visualize the quantitative data that lies in exam one grades. I can use the hist function from the pyplot submodule of Matplotlib. It would look like this. First I'll call the hist function and pass in exam one grades. Next I'll call the X label function to set the label of the X-axis. Then I'll call the Y label function to set the label of the Y-axis and I'll call the title function to set the title of the plot. Lastly, I'll call the show function to make sure that the…

Contents