Part 3 - Visualization of casesΒΆ

In this part of the tutorial you can find some of the functions of the * Cases Plot * class, in particular this class inherits the properties of the Matplotlib class.

As usual the first step will be to import the arcovid19 module.

import arcovid19 as ac
import matplotlib.pyplot as plt

The next cell performs a cache cleanup, as arcovid19 saves a one-hour chache for every request made to the online database. With this action, we make sure that we are using an updated database.


We loaded the COVID-19 database from Argentina.

cases = ac.load_cases()

The plot method shows the trend to date of each of the provinces along with that of Argentina. By default, it shows confirmed cases, but you can also choose to view active, recovered and dead cases.

fig, ax = plt.subplots(figsize=(20, 8))
cases.plot(ax=ax, confirmed=False, active=True, recovered=False, deceased=False)
<matplotlib.legend.Legend at 0x7f64e33fb400>

Then if you are interested in a particular province, you just have to add grate_full_periode and specify the name of the province. If you do not enter the name of any province the tool will show you the cases of Argentina.

ax = cases.plot.grate_full_period('Bs As', confirmed=True, active=True, recovered=True, deceased=True)
/home/docs/checkouts/ DeprecationWarning: Call to deprecated method grate_full_period. (use growth_provincia instead) -- Deprecated since version 0.5.
  """Entry point for launching an IPython kernel.

Also, if you want to observe the behavior of observations by date, you can use the following graphical representations.

<matplotlib.axes._subplots.AxesSubplot at 0x7f64e111f208>
<matplotlib.axes._subplots.AxesSubplot at 0x7f64e0fe2860>
<matplotlib.axes._subplots.AxesSubplot at 0x7f64deb142e8>
<matplotlib.axes._subplots.AxesSubplot at 0x7f64de6e3c88>

Finally, at the following link part 3 you will find an updated guide on March 28, 2020, of part 3 of the tutorial.