From the course: Python for Data Visualization
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Set titles, labels, and limits - Python Tutorial
From the course: Python for Data Visualization
Set titles, labels, and limits
- [Instructor] In this video, I'll show you how to create plot titles, labels, and limits. Plot titles and plot labels are very important to convey what you're graphing and plot limits are very important as, oftentimes, the default limits aren't always ideal with Matplotlib. The first thing we're going to do is we're going to go for the MATLAB style for how to set plot titles, labels, and limits. So here's a normal MATLAB-style plot. Notice in the graph that there's no title in the plot. There's no y label, there's no x label, and the limits could be a little bit better on the x-axis where it looks like the plot should start at one and should end at 60. To change the x limit and the y limit, you can do .xlim where you have your limit on the left and your limit on the right. To change your y limit, you can do .ylim, you can have your lower limit and you can have your upper limit, and you can do Shift + Enter. And…
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)
Basics of Matplotlib3m 49s
-
(Locked)
Set marker type and colors1m 52s
-
(Locked)
MATLAB-style vs. object syntax2m 7s
-
(Locked)
Set titles, labels, and limits4m 21s
-
(Locked)
Add grids2m 26s
-
(Locked)
Create legends1m 25s
-
(Locked)
Save plots to files2m 28s
-
(Locked)
Create plots with Matplotlib wrappers5m
-
(Locked)
-
-