From the course: Data Visualization with Matplotlib and Seaborn
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Solution: Plotting DataFrames - Python Tutorial
From the course: Data Visualization with Matplotlib and Seaborn
Solution: Plotting DataFrames
- [Instructor] Okay, welcome back, everybody. As I mentioned before, there are a couple ways to plot with data frames. You might have chosen to plot each series individually, or you might have just chosen to pass the entire data frame into the plot function. For this case, either method would work, both methods are acceptable. Again, as we start customizing our charts, you know, we'll start to lean towards this top method where we really plot each series individually. But if you plotted the data frame, hey, that saved you some time. Let's go ahead and walk through our solutions. Okay, so let's go ahead and create our figure and axis objects. So this will equal plot.subplots. And then the first method for solving this would just be to use plot on our axis object and pass in our monthly revenue data frame. And we will end up with two charts here. And again, our x axis is very ugly. We'll learn how to format our charts, and make this a little bit better. But if you got a chart that looks…
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)
Intro to Matplotlib6m 39s
-
(Locked)
Plotting methods6m 56s
-
(Locked)
Plotting DataFrames5m 35s
-
(Locked)
Challenge: Plotting DataFrames3m 14s
-
(Locked)
Solution: Plotting DataFrames2m 26s
-
(Locked)
Anatomy of a Matplotlib figure4m 9s
-
(Locked)
Chart titles and font sizes9m 46s
-
(Locked)
Chart legends10m 21s
-
(Locked)
Line styles2m 54s
-
(Locked)
Axis limits5m 30s
-
(Locked)
Figure sizes5m 13s
-
(Locked)
Custom axis ticks4m 3s
-
(Locked)
Vertical lines6m 43s
-
(Locked)
Adding text4m 38s
-
(Locked)
Pro tip: Text annotations5m 18s
-
(Locked)
Removing borders5m 59s
-
(Locked)
Challenge: Formatting charts2m 7s
-
(Locked)
Solution: Formatting charts2m 55s
-
(Locked)
Line charts3m 30s
-
(Locked)
Stacked line charts6m 41s
-
(Locked)
Dual axis charts8m 51s
-
(Locked)
Challenge: Dual axis line charts1m 51s
-
(Locked)
Solution: Dual axis line charts2m 43s
-
(Locked)
Bar charts10m 19s
-
(Locked)
Challenge: Bar charts1m 23s
-
(Locked)
Solution: Bar charts2m 37s
-
(Locked)
Stacked bar charts5m 25s
-
(Locked)
Grouped bar charts7m 38s
-
(Locked)
Combo charts7m 56s
-
(Locked)
Challenge: Advanced bar charts1m 22s
-
(Locked)
Solution: Advanced bar charts2m 56s
-
(Locked)
Pie and donut charts10m 37s
-
(Locked)
Challenge: Pie and donut charts1m 15s
-
(Locked)
Solution: Pie and donut charts2m 2s
-
(Locked)
Scatterplots and bubble charts5m 13s
-
(Locked)
Histograms10m 10s
-
(Locked)
Challenge: Scatterplots and histograms1m 40s
-
(Locked)
Solution: Scatterplots and histograms2m 44s
-
(Locked)
Key takeaways2m 23s
-
(Locked)
-
-
-
-
-