From the course: Data Visualization with Matplotlib and Seaborn

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Pro tip: Text annotations

Pro tip: Text annotations

- [Instructor] Okay, so in the last version of our chart, we put text into our chart to point out when the start of Covid was. Another way to do this that will give you a little bit prettier arrow is using annotations. These can seem very complex at first, but a lot of the times we're just going to develop a very simple template and use that style every time we use annotations. There are a ton of options for these, but let's take a look at what an annotation is. These are a great way to call-out and label important data points. So in order to annotate a specific point, we want to provide a string. This is going to be the text that we're calling out. We then need to specify the data point coordinate that we want to point to, followed by the text coordinate, and then the style of arrow we want to provide. We can also format our text just like we saw in the last demo. So here's an example of annotating a chart. So we're just going to include the last piece of our code here. But let's…

Contents