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

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…

Contents