Exercise

Rainfall plot type buttons

You have been contacted by the Australian Bureau of Meteorology to assist them in understanding monthly rainfall.

They are not sure what plot would be best to visualize this data, so are wondering if there is a way to make this part of the interactivity. They don't want subplots, as they will only need to view one plot at at time.

Your task is to create a bar plot of rainfall per month with a button that allows the user to easily change from a bar plot to a scatterplot of the same data.

A rain DataFrame is loaded for you.

Instructions

100 XP
  • Create a simple bar chart from the provided DataFrame, with the Month on the x-axis and Rainfall on y-axis.
  • Create a button for the bar plot and scatterplot using the plot type argument fed to args.
  • Add the buttons to the plot, setting the direction to down so the buttons are on top of each other.