From the course: Data Analysis with Python and Pandas

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Bar charts

Bar charts

- [Instructor] Okay, so we've taken a look pretty in depth at the line chart, which is going to be the default chart when we call the plot method. We've also taken a look at several different types of ways to format our charts, but what we haven't looked at is different chart types. There are quite a few chart types available to us in Matplotlib, and we're going to walk through a few here. In order to change our chart type, we can do a few things. One thing that we can do is just specify the kind argument within the plot method. Here we're specifying kind equals bar, and then that results in a bar plot as opposed to a line plot. The way that I prefer is to actually specify .plot.bar. So we can specify the chart type after calling plot and chain that to our plot method. At this point, our arguments for our chart now live in that chart attribute. So any argument that's going to be valid for a bar chart will live inside of our bar attribute here. Whereas if we specify plot and then just…

Contents