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
From the course: Data Analysis with Python and Pandas
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
The Matplotlib API and the plot() method9m 33s
-
(Locked)
Challenge: Basic line chart49s
-
(Locked)
Solution: Basic line chart3m 1s
-
(Locked)
Chart titles3m 26s
-
(Locked)
Chart colors5m 13s
-
(Locked)
Line styles2m 1s
-
(Locked)
Chart legends and gridlines3m 51s
-
(Locked)
Chart styles4m 8s
-
(Locked)
Challenge: Stylized line chart1m 11s
-
(Locked)
Solution: Stylized line chart1m 21s
-
(Locked)
Subplots and figure size5m 28s
-
(Locked)
Challenge: Subplots1m 33s
-
(Locked)
Solution: Subplots2m 59s
-
(Locked)
Bar charts6m 13s
-
(Locked)
Grouped and stacked bar charts5m 9s
-
(Locked)
Challenge: Bar charts1m 11s
-
(Locked)
Solution: Bar charts2m 19s
-
(Locked)
Pie charts and scatterplots6m 52s
-
(Locked)
Challenge: Scatterplots1m
-
(Locked)
Solution: Scatterplots2m 10s
-
(Locked)
Histograms3m 46s
-
(Locked)
Challenge: Histograms33s
-
(Locked)
Solution: Histograms1m 18s
-
(Locked)
Saving plots and further exploration3m 41s
-
(Locked)
Key takeaways2m 12s
-
(Locked)
-
-
-
-
-