Using line plots to examine trends in continuous variables
A typical way to visualize values for a continuous variable over regular intervals of time is through a line plot, though sometimes bar charts are used for small numbers of intervals. We will use line plots in this recipe to display variable trends and examine sudden deviations in trends and differences in values over time by groups.
Getting ready
We will work with daily COVID-19 case data in this recipe. In previous recipes, we have used totals by country. The daily data provides us with the number of new cases and new deaths each day by country, in addition to the same demographic variables we used in other recipes. You will need Matplotlib installed to run the code in this recipe.
How to do it…
We use line plots to visualize trends in daily COVID-19 cases and deaths. We create line plots by region, and stacked plots to get a better sense of how much one country can drive the number of cases for a...