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 annotations to plots

Adding annotations to plots - Python Tutorial

From the course: Python for Marketing (2019)

Adding annotations to plots

- [Instructor] I don't think there's any clearer way of explaining what the data consists of and areas that you want people to pay attention to than using annotations. Annotations allow you to apply little arrows and some text next to specific data points that you want to highlight in your dataset, so it makes it abundantly clear to anybody, even if they're an expert or not, to look here, this is an important point. And to do this with matplotlib, subplots, and pandas together is actually quite easy, and I'm going to show you how to do that right now. So we have created a subplot with clicks and page views. Page views are sitting on the x-axis. We have some customizations with the colors, so yellow and light green. We have a custom width and also we're sending positions across as well. In order to do an annotation we want to apply this annotation to ax, so that's this subplot. First we want to say what the annotation is,…

Contents