Animation in Plotly
In this homework, we’ll be recreating the plot on US income inequality shown here. We’ve provided for you two csv files of information about the highest and lowest average incomes in the United States over time.
The first csv file is here and it represents the average income of the top 1% of income earners in the United States from 1913 to 2014.
The second csv file is here and it represents the average income of the bottom 90% of income earners in the United States from 1913 to 2014.
We’ve embedded our example here that should give you an indication of how your plot should look. Please refer to your work for ACT3-5, since the code will remain largely the same.
Our requirements for this homework include:
- Displays all data points
- Graph and axes have an appropriate range and are labeled
- Has a slider allows you to display data from various years
- Data displayed changes based on the year, but data from previous years remains on the graph
You can use different colors for the data points by passing in a list of strings instead of a single string specifying the color. You can also create text labels for each data point. e.g. the year in addition to the x and y axis values. Another idea is to plot all the data points in gray first, where the data points progressively become colored as the animation progresses. Feel free to be creative with this!
Once you're done, share your file with
firstname.lastname@example.org by midnight, 4/28.
Make sure your submission has your name in the filename:
FirstLast_HW3-5.py. “FirstLast” should be replaced with your first and last name or we will take off points. Make sure every task has been completed.