This repo is meant to serve as a solution to this question.
Use generate_data.py
to generate the data present in data.csv
.
Run app.py
to have a look at the figures in action. Here I have used a single figure to display both the plots as I thought this is neat.
However if you want, you can look at app2.py
. It is closer to your implementation.