From the course: Python for Marketing (2019)

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Adding x and y labels to a plot

Adding x and y labels to a plot - Python Tutorial

From the course: Python for Marketing (2019)

Adding x and y labels to a plot

- [Instructor] We're going to want to add labels to our x and y-axis so when we are communicating with people it's very clear what they are looking at. Many times I've seen graphs and they are not labeled properly and I'm like I have no idea what I'm looking at right now. And people usually won't tell you if they don't understand the chart. So you're going to make it super clear for people because when you're communicating to them, you're trying to get them onboard to do what you need them to do or you're trying show them how good you are so labeling your charts is a good starting point for that. So we're going to create a variable called fig. In there, plt, that's referencing Matplotlib. Then we're looking for the function figure and I'm passing the figure size here, so it's 15 wide, five high. Then we're creating two sub plots, ax and ax2. We're going to use fig.add_subplot 111, so that's number of rows, columns…

Contents