COVID-19 US County Death Timeline Plots
Bob Sandheinrich
Create timeline plots of New York Times county-by-county data for COVID-19 deaths.
Retrieve Data
Get the latest data from the
New York Times
using the
NYTimesCOVID19Data
resource function:
I
n
[
]
:
=
A
b
s
o
l
u
t
e
T
i
m
i
n
g
[
t
i
m
e
s
e
r
i
e
s
=
R
e
s
o
u
r
c
e
F
u
n
c
t
i
o
n
[
"
N
Y
T
i
m
e
s
C
O
V
I
D
1
9
D
a
t
a
"
]
[
"
U
S
C
o
u
n
t
i
e
s
T
i
m
e
S
e
r
i
e
s
"
]
;
]
Plotting Tools
Making log trend lines
This is pretty hacky—
Epilog
with
DateListLogPlot
is not easy to use, but I experimentally found some values that look alright.
Decide how long the trend lines should be and define a vertical offset (the offset was chosen experimentally and may need to be adjusted):
I
n
[
]
:
=
$
l
i
n
e
d
a
y
s
=
3
0
;
$
s
t
a
r
t
l
i
n
e
v
a
l
u
e
=
2
.
5
;
Define functions for making trendlines and labeling them:
I
n
[
]
:
=
m
a
k
e
l
i
n
e
[
a
_
]
:
=
N
@
{
D
a
r
k
e
r
[
C
o
l
o
r
D
a
t
a
[
"
T
e
m
p
e
r
a
t
u
r
e
M
a
p
"
]
[
1
/
2
+
1
/
(
a
/
2
)
]
,
.
2
]
,
L
i
n
e
[
{
{
N
o
w
,
$
s
t
a
r
t
l
i
n
e
v
a
l
u
e
}
,
{
N
o
w
+
Q
u
a
n
t
i
t
y
[
$
l
i
n
e
d
a
y
s
,
"
D
a
y
s
"
]
,
$
s
t
a
r
t
l
i
n
e
v
a
l
u
e
+
(
$
l
i
n
e
d
a
y
s
/
a
)
}
}
]
,
T
e
x
t
[
"
D
o
u
b
l
e
s
e
v
e
r
y
"
<
>
T
o
S
t
r
i
n
g
[
a
]
<
>
"
d
a
y
s
"
,
t
e
x
t
l
o
c
a
t
i
o
n
[
a
]
]
}
I
n
[
]
:
=
t
e
x
t
l
o
c
a
t
i
o
n
[
a
_
]
:
=
I
f
[
2
^
(
$
l
i
n
e
d
a
y
s
/
a
)
<
1
0
0
,
{
N
o
w
+
Q
u
a
n
t
i
t
y
[
$
l
i
n
e
d
a
y
s
,
"
D
a
y
s
"
]
,
$
s
t
a
r
t
l
i
n
e
v
a
l
u
e
+
(
$
l
i
n
e
d
a
y
s
/
a
)
}
,
W
i
t
h
[
{
d
=
F
i
r
s
t
[
x
/
.
N
S
o
l
v
e
[
2
^
(
x
/
a
)
1
0
0
.
&
&
x
>
0
,
x
]
]
}
,
{
N
o
w
+
Q
u
a
n
t
i
t
y
[
d
-
5
,
"
D
a
y
s
"
]
,
N
@
L
o
g
[
2
,
1
0
0
]
}
]
]
Define
DateListPlot
options:
I
n
[
]
:
=
$
p
l
o
t
o
p
t
s
=
S
e
q
u
e
n
c
e
@
@
{
F
r
a
m
e
T
i
c
k
s
{
N
o
n
e
,
A
u
t
o
m
a
t
i
c
}
,
P
l
o
t
R
a
n
g
e
{
A
u
t
o
m
a
t
i
c
,
{
5
,
A
u
t
o
m
a
t
i
c
}
}
,
P
l
o
t
L
e
g
e
n
d
s
N
o
n
e
,
P
l
o
t
L
a
b
e
l
s
P
l
a
c
e
d
[
A
u
t
o
m
a
t
i
c
,
R
i
g
h
t
,
S
t
r
i
n
g
D
e
l
e
t
e
[
C
o
m
m
o
n
N
a
m
e
[
#
]
,
"
,
U
n
i
t
e
d
S
t
a
t
e
s
"
]
&
]
,
E
p
i
l
o
g
{
D
a
s
h
e
d
,
m
a
k
e
l
i
n
e
/
@
{
3
,
5
,
1
0
}
}
,
I
m
a
g
e
S
i
z
e
8
0
0
}
;
Select Data
Select only data for counties that have had a minimum number of deaths for a minimum number of days, then align the first timestamp of each time series using the
TimeSeriesAlign
resource function:
I
n
[
]
:
=
$
m
i
n
d
e
a
t
h
s
=
1
0
;
$
m
i
n
d
a
y
s
=
1
8
;
I
n
[
]
:
=
h
i
g
h
d
e
a
t
h
s
=
t
i
m
e
s
e
r
i
e
s
[
A
l
l
,
R
e
s
o
u
r
c
e
F
u
n
c
t
i
o
n
[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