1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Data Visualization with Plotly in Python

Connected

Exercise

Annotating your savings

You have worked hard over the last 30 weeks to build your savings balance for your first car. However, some extra context needs to be added to explain a drop in savings and, later, a big increase in savings accumulated each fortnight.

Your task is to annotate the bar chart of your savings balance over the weeks and add two key annotations to the plot to explain what happened.

A figure fig has already been created using a savings DataFrame (with x as Week) for you.

Instructions

100 XP
  • Create the loss_annotation at week 10 (savings 400) with the text "Urgent House Repairs".
  • Create the gain_annotation at week 18 (savings 2500) with the text "New Job".
  • Add both annotations to the fig using update_layout().