# Plotting daily death using Makie

**URL:** https://discourse.julialang.org/t/plotting-daily-death-using-makie/106895
**Category:** New to Julia
**Tags:** question, plotting, makie
**Created:** [November 29, 2023, 10:36am UTC](https://discourse.julialang.org/t/plotting-daily-death-using-makie/106895 "2023-11-29T10:36:06Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Chao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chao/32/50725_2.png) [@Chao](https://discourse.julialang.org/u/Chao)
#### Post date: [November 29, 2023, 10:36am UTC](https://discourse.julialang.org/t/plotting-daily-death-using-makie/106895/1 "2023-11-29T10:36:06Z")

</div>

Hello, I am plotting the daily new death per day. It should be a line, but it looks strange.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/8/c/8cd4da6e5283111df1403ea0faf397cf110559bc.png)

Here are my codes:

```julia
# read the data
covid_death = filter(row -> row.location == "Germany" && row.date >= Date(2020, 6, 1) && row.date <= Date(2021, 5, 31), 
CSV.read("..../owid-covid-data_casedeathoxfordindex.csv", DataFrame)) # 365×67 DataFrame

# plot the figure with grey background
f = Figure(backgroundcolor = RGBf(0.98, 0.98, 0.98), size = (1000, 900))

# Setting up GridLayouts
ga = f[1, 1] = GridLayout()
gb = f[2, 1] = GridLayout()
gc = f[3, 1] = GridLayout()

# Panel A
ax = Axis(ga[1,1])
days = length(covid_death.date)
lines!(ax, 1:days, covid_death.new_deaths_per_million,
ylabel = "new_deaths_per_million")
ax.xticks = (1:30:days, string.(covid_death.date)[1:30:days])

f

```

Thank you.

Solved. Because of this.  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/8/a889657a113a44c63e68a274fe25daa887d7b891.png)

---

<div class="post-metadata">

### Author: ![SteffenPL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steffenpl/32/206270_2.png) [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)
#### Post date: [November 29, 2023, 10:40am UTC](https://discourse.julialang.org/t/plotting-daily-death-using-makie/106895/2 "2023-11-29T10:40:03Z")

</div>

Seems like the data peaks on a particular weekday. You could smoothen the data so see a trend, e.g. using moving averages. Are you sure that the plot is wrong, or could it be the data itself looking like this?

---

<div class="post-metadata">

### Author: ![Chao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chao/32/50725_2.png) [@Chao](https://discourse.julialang.org/u/Chao)
#### Post date: [November 29, 2023, 10:52am UTC](https://discourse.julialang.org/t/plotting-daily-death-using-makie/106895/3 "2023-11-29T10:52:20Z")

</div>

Thank you. I know where I am wrong.

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [November 29, 2023, 12:17pm UTC](https://discourse.julialang.org/t/plotting-daily-death-using-makie/106895/4 "2023-11-29T12:17:24Z")

</div>

If I remember right, certainly in the UK, the data for Covid peaked on certain days due to reporting - the reporting was done sometimes on a Monday after a weekend so the data got skewed to Mondays.  
I could be wrong

---

<div class="post-metadata">

### Author: ![Chao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chao/32/50725_2.png) [@Chao](https://discourse.julialang.org/u/Chao)
#### Post date: [November 29, 2023, 12:56pm UTC](https://discourse.julialang.org/t/plotting-daily-death-using-makie/106895/6 "2023-11-29T12:56:17Z")

</div>

Yes, I checked the data. The number of deaths per million for Germany was also provided once a week. In the dataset, when there was no result, it came to 0.0. That is why the line goes up and down.

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [November 29, 2023, 1:09pm UTC](https://discourse.julialang.org/t/plotting-daily-death-using-makie/106895/7 "2023-11-29T13:09:48Z")

</div>

@chao you should tune into the thread on Missing values

[Why are missing values not ignored by default? - Internals & Design - Julia Programming Language (julialang.org)](https://discourse.julialang.org/t/why-are-missing-values-not-ignored-by-default/106756)
