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 - 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…
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)
Custom visualizations in Python42s
-
(Locked)
Import, explore, and plot a basic chart4m 48s
-
(Locked)
Creating Matplotlib subplots2m 59s
-
(Locked)
Plotting a secondary y-axis2m 40s
-
(Locked)
Adding x and y labels to a plot2m 40s
-
(Locked)
Rotating xticks labels on plot2m 1s
-
(Locked)
Adding a legend to a plot1m 5s
-
(Locked)
Adding a title to your plot1m 26s
-
(Locked)
Adding annotations to plots3m
-
(Locked)
Switching between Matplotlib styles1m 3s
-
(Locked)
Using a scatter plot in Seaborn1m 8s
-
(Locked)
Customizing a scatter plot in Seaborn2m 21s
-
(Locked)
Creating a Facebook Ads heatmap in Seaborn2m 56s
-
(Locked)
-
-
-
-