From the course: Python Data Visualization: Create Impactful Visuals, Animations, and Dashboards by Pearson
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Demo, part 1 - Python Tutorial
From the course: Python Data Visualization: Create Impactful Visuals, Animations, and Dashboards by Pearson
Demo, part 1
As before, I'm importing all the packages and modules that I'm going to be using right at the beginning. Of course, here, the star of the show is Matplotlib, so I start by importing that. Of course, also pandas and NumPy, because they'll come in handy. And as part of matplotlib, I'm also importing a few of the sub-modules that it And that gives us a red line. Everything remains the same. just the color gets changed to red. We can also add a legend. So here we're starting with plt.plot x and y in red, and then adding a legend. For the legend, you have to provide a list of strings that you want to use for the legend. Here, because we're only plotting one thing, our list only has one value, and in this case, I'm using sin function as my legend. MantlotLib automatically decides where the legend box should be placed. The default usually is the top right-hand corner, but if there's things plotted on that corner, it might end up on one of the other corners. If you call plt.plot multiple…
Contents
-
-
-
-
-
-
(Locked)
Topics33s
-
(Locked)
Fundamental components of a Matplotlib plot5m 33s
-
(Locked)
Explore the Matplotlib API8m 14s
-
(Locked)
Demo, part 122m 42s
-
(Locked)
Demo, part 221m 33s
-
(Locked)
Demo, part 325m 58s
-
(Locked)
Stylesheets4m 39s
-
(Locked)
Demo8m 26s
-
(Locked)
Mapping10m 21s
-
(Locked)
Demo24m 9s
-
(Locked)
-
-
-
-
-
-