File:SARS-CoV-2 infections in and around Poland en.svg
Original file (SVG file, nominally 512 × 384 pixels, file size: 39 KB)
Captions
This SVG file contains embedded text that can be translated into your language, using any capable SVG editor, text editor or the SVG Translate tool. For more information see: About translating SVG files. |
Contents
Summary
[edit]DescriptionSARS-CoV-2 infections in and around Poland en.svg |
Français : Les cas confirmés de SARS-CoV-2 en Pologne et dans les sept pays partageant une frontière terrestre avec la Pologne; une ligne montre une croissance de 30%/jour
English: SARS-CoV-2 lab-confirmed cases in Poland and in the seven neighbouring countries sharing land borders with Poland; a line shows a 30% increase/day
Polski: Liczba zakażeń SARS-CoV-2 w Polsce i u sąsiadów; kreska pokazuje wzrost 30%/dzień |
Date | |
Source | Own work - see the source code below |
Author | Boud |
Other versions | File:SARS-CoV-2 infections in and around Poland pl.svg |
Licensing
[edit]- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Manual checks on source data
[edit]The charts are at:
Source code (CC-BY-SA-4.0)
[edit]Bash script for octave plot or Graph:Chart mediawiki code
[edit]This bash script generates an updated set of content from en.Wikipedia medical cases chart data to paste manually into, for example, w:2020 coronavirus pandemic in Poland#Spread of SARS-CoV-2 within and around Poland. You should preview and check the map before saving. Read, check and understand the script to find out how to do a fresh download (not difficult).
#!/bin/bash
# pl_sarscov2 - Polish neighbourhood SARS-CoV-2 pandemic data
# (C) Wikimedia Commons User:Boud, 2020 CC-BY-SA-4.0
# https://creativecommons.org/licenses/by-sa/4.0/
# https://creativecommons.org/2015/10/08/cc-by-sa-4-0-now-one-way-compatible-with-gplv3/
# This component downloads and tidies the data into files, and runs
# pl_sarscov2.m through octave.
# TODO: 2020-03-17: This script is hardwired to handle March. Minor
# generalisations to handle April, May or later will be needed.
## START in March 2020
START=4
## TODAY in March 2020
TODAY=26
DAILY=true
#DAILY=false
## exponential for comparison: value on first date
if (${DAILY}); then
EXP_START=20
else
EXP_START=100
fi
## exponential for comparison: +${PERCENT} per day
PERCENT=25
URL_PL="https://en.wikipedia.org/w/index.php?title=Template:2019%E2%80%9320_coronavirus_pandemic_data/Poland_medical_cases_chart&action=edit"
## EU terrestrial neighbours of PL
URL_DE="https://en.wikipedia.org/w/index.php?title=Template:2019%E2%80%9320_coronavirus_pandemic_data/Germany_medical_cases_chart&action=edit"
URL_LT="https://en.wikipedia.org/w/index.php?title=Template:2019%E2%80%9320_coronavirus_pandemic_data/Lithuania_medical_cases_chart&action=edit"
#CZ bar stacked
URL_CZ="https://en.wikipedia.org/w/index.php?title=Template:2019%E2%80%9320_coronavirus_pandemic_data/Czech_Republic_medical_cases_chart&action=edit"
#SK
URL_SK="https://en.wikipedia.org/w/index.php?title=Template:2019%E2%80%9320_coronavirus_pandemic_data/Slovakia_medical_cases_chart&action=edit"
## non-EU terrestrial neighbours of PL
# https://en.wikipedia.org/wiki/2020_coronavirus_pandemic_in_Belarus
URL_BY="https://en.wikipedia.org/w/index.php?title=Template:2019%E2%80%9320_coronavirus_pandemic_data/Belarus_medical_cases_chart&action=edit"
URL_RU="https://en.wikipedia.org/w/index.php?title=Template:2019%E2%80%9320_coronavirus_pandemic_data/Russia_medical_cases_chart&action=edit"
URL_UA="https://en.wikipedia.org/w/index.php?title=Template:2019%E2%80%9320_coronavirus_pandemic_data/Ukraine_medical_cases_chart&action=edit"
## set to YES to enable
RECOV=no
TMP_PL=/tmp/tmpsemilogpl.data
TMP_DE=/tmp/tmpsemilogde.data
TMP_LT=/tmp/tmpsemiloglt.data
TMP_CZ=/tmp/tmpsemilogcz.data
TMP_SK=/tmp/tmpsemilogsk.data
TMP_BY=/tmp/tmpsemilogby.data
TMP_RU=/tmp/tmpsemilogru.data
TMP_UA=/tmp/tmpsemilogua.data
TMP_OCT=/tmp/tmpsemilog_oct.data
TMP_WMEDIA=/tmp/tmpsemilog_wmedia.data
TMP1=$(mktemp /tmp/tmpsemilog_pl.XXXXXXX)
TMP2=$(mktemp /tmp/tmpsemilog_pl.XXXXXXX)
TMP3=$(mktemp /tmp/tmpsemilog_pl.XXXXXXX)
TMP4=$(mktemp /tmp/tmpsemilog_pl.XXXXXXX)
TMP5=$(mktemp /tmp/tmpsemilog_pl.XXXXXXX)
TMP6=$(mktemp /tmp/tmpsemilog_pl.XXXXXXX)
TMP7=$(mktemp /tmp/tmpsemilog_pl.XXXXXXX)
TMP8=$(mktemp /tmp/tmpsemilog_pl.XXXXXXX)
TMP_X=$(mktemp /tmp/tmpsemilog_pl.XXXXXXX)
function sleep_a_bit {
## We do not want to overload Wikimedia Foundation servers.
sleep $(shuf -i 5-10|tail -n1) # wait 5 to 10 seconds
}
function do_download {
wget -O ${TMP_PL} "${URL_PL}"
sleep_a_bit
wget -O ${TMP_DE} "${URL_DE}"
sleep_a_bit
wget -O ${TMP_LT} "${URL_LT}"
sleep_a_bit
wget -O ${TMP_CZ} "${URL_CZ}"
sleep_a_bit
wget -O ${TMP_SK} "${URL_SK}"
sleep_a_bit
wget -O ${TMP_BY} "${URL_BY}"
sleep_a_bit
wget -O ${TMP_RU} "${URL_RU}"
sleep_a_bit
wget -O ${TMP_UA} "${URL_UA}"
}
function russia_hack {
## Russia hack
## This relates to the greps and regular expressions used
## below for parsing the source files.
mv -v ${TMP_RU} ${TMP_X}
sed -e 's/Row|||2|3|/Row|2020-03-04||2|3|/' ${TMP_X} | \
sed -e 's/Row|||3|10|/Row|2020-03-10||3|10|/' ${TMP_X} > \
${TMP_RU}
}
function grep_medical_cases_octave {
TMP_XX=$1
TMP_OUT=$2
## day-of-month; total lab-confirmed cases; deaths; recoveries
grep "^{{[mM]edical cases chart/Row" ${TMP_XX} | \
grep "2020-03" | \
tr -d ' ' | \
awk -F '|' '{print $2,$5,"0"$3,"0"$4}' | sed -e 's/2020-03-//' > ${TMP_OUT}
printf "\n" >> ${TMP_OUT}
}
function grep_bar_chart_octave {
TMP_XX=$1
TMP_OUT=$2
## day-of-month; total lab-confirmed cases; deaths; recoveries
grep "^{{[Bb]ar stacked" ${TMP_XX} | \
grep "2020-03" | \
sed -e "s;.*[Bb]ar stacked.*2020-03-\([0-9]*\)[^0-9][^:]*expr: *\([0-9][0-9]*\)/[^:]*expr: *\([0-9][0-9]*\)/[^:]*expr: *\([0-9][0-9]*\)/.*;\1 \2 \3 \4;" | \
awk '{print $1,$2+$3+$4,$2,$3}' > ${TMP_OUT}
printf "\n" >> ${TMP_OUT}
}
function plot_mediawiki_top {
if ( [ -e ${TMP_PL} ] && [ -e ${TMP_DE} ] && [ -e ${TMP_LT} ] && [ -e ${TMP_BY} ] && [ -e ${TMP_RU} ] && [ -e ${TMP_CZ} ] && [ -e ${TMP_SK} ] && [ -e ${TMP_UA} ] ); then
cat <<EOF > ${TMP_WMEDIA}
{{Graph:Chart
| width = 500
| height = 300
| type = line
| yGrid =
| xGrid =
| xAxisAngle = -90
| yScaleType = log
| yAxisMin = 1
| colors = #e00000, #005000, #007000, #00a000, #70a080, #000090, #5000b0, #1050ff, #000000
EOF
printf " | x = " >> ${TMP_WMEDIA}
for ((d=${START}; d<=${TODAY}; d++)); do
if [ ${d} -le 31 ]; then
printf "${d}/3" >> ${TMP_WMEDIA}
elif [ "${d}" -le 61 ]; then
e=$((d-31))
printf "${e}/4" >> ${TMP_WMEDIA}
elif [ "${d}" -le 92 ]; then
e=$((d-61))
printf "${e}/5" >> ${TMP_WMEDIA}
else
printf "It is now June\! Please update the script\!"
fi
if [ ${d} -lt ${TODAY} ]; then
printf ", " >> ${TMP_WMEDIA}
fi
done
printf "\n" >> ${TMP_WMEDIA}
else
printf "${TMP_PL} or ${TMP_DE} or ... does not exist.\n"
printf "Try the 'w' parameter to download.\n"
fi
}
function plot_mediawiki_xx {
printf " | $1= " >> ${TMP_WMEDIA}
TMP_XX=$2
TMP_OUT=$3
## day-of-month; total lab-confirmed cases; deaths; recoveries
## TODO: update for April, May, ...
grep "^{{[mM]edical cases chart/Row" ${TMP_XX} | \
grep "2020-03" | \
tr -d ' ' | \
awk -F '|' '{print $2,$5}' | sed -e 's/2020-03-//' > ${TMP_OUT}
n_old=0
for ((d=${START}; d<=${TODAY}; d++)); do
if (${DAILY}); then
n_new=$(cat ${TMP_OUT} | \
awk -v d=${d} '{if ($1 == d) printf $2}')
if [ "x${n_new}" = "x" ]; then
# use the old value if the new value is invalid
printf ""
n_new=${n_old}
fi
delta_n=$((${n_new}-${n_old}))
printf "${delta_n}" >> ${TMP_WMEDIA}
if [ "x${n_new}" != "x" ]; then
# copy a valid new value to the old one
n_old=${n_new}
fi
## debug only
#printf "n_new=${n_new}; n_old=${n_old}; delta_n=${delta_n}\n"
if [ ${d} -lt ${TODAY} ]; then
printf ", " >> ${TMP_WMEDIA}
fi
else
cat ${TMP_OUT} | \
awk -v d=${d} '{if ($1 == d) printf $2}' >> ${TMP_WMEDIA}
if [ ${d} -lt ${TODAY} ]; then
printf ", " >> ${TMP_WMEDIA}
fi
fi
done
printf "\n" >> ${TMP_WMEDIA}
}
function plot_mediawiki_exponential {
## avoid FR/PL language environment with decimal comma!
OLD_LANG=${LANG}
LANG=C
EXP_FINAL=$(echo "x" | awk -v n1=${EXP_START} -v power="1.${PERCENT}" -v days=$((${TODAY}-${START})) \
'{print int(n1*power^days+0.5)}')
printf " | y9= ${EXP_START}, " >> ${TMP_WMEDIA}
for ((d=$((${START}+1)); d<${TODAY}; d++)); do
printf ", " >> ${TMP_WMEDIA}
done
printf "${EXP_FINAL}\n" >> ${TMP_WMEDIA}
LANG=${OLD_LANG}
}
function plot_mediawiki {
plot_mediawiki_top
plot_mediawiki_xx "y1" ${TMP_PL} ${TMP_OCT}.PL
plot_mediawiki_xx "y2" ${TMP_DE} ${TMP_OCT}.DE
plot_mediawiki_xx "y3" ${TMP_CZ} ${TMP_OCT}.CZ
plot_mediawiki_xx "y4" ${TMP_SK} ${TMP_OCT}.SK
plot_mediawiki_xx "y5" ${TMP_LT} ${TMP_OCT}.LT
plot_mediawiki_xx "y6" ${TMP_RU} ${TMP_OCT}.RU
plot_mediawiki_xx "y7" ${TMP_BY} ${TMP_OCT}.BY
plot_mediawiki_xx "y8" ${TMP_UA} ${TMP_OCT}.UA
plot_mediawiki_exponential
plot_mediawiki_bottom
}
function plot_mediawiki_bottom {
cat <<EOF >> ${TMP_WMEDIA}
| legend =
| showSymbols =
| y1Title = PL
| y2Title = DE
| y3Title = CZ
| y4Title = SK
| y5Title = LT
| y6Title = RU
| y7Title = BY
| y8Title = UA
| y9Title = +${PERCENT}%/day
| xAxisTitle=day/month in 2020
| yAxisTitle=count
}}
EOF
}
function plot_octave {
if ( [ -e ${TMP_PL} ] && [ -e ${TMP_DE} ] && [ -e ${TMP_LT} ] && [ -e ${TMP_BY} ] && [ -e ${TMP_RU} ] ); then
grep_medical_cases_octave ${TMP_PL} ${TMP_OCT}.PL
grep_medical_cases_octave ${TMP_DE} ${TMP_OCT}.DE
grep_medical_cases_octave ${TMP_LT} ${TMP_OCT}.LT
grep_medical_cases_octave ${TMP_CZ} ${TMP_OCT}.CZ # updated 2020-03-19
grep_medical_cases_octave ${TMP_SK} ${TMP_OCT}.SK # updated 2020-03-19
grep_medical_cases_octave ${TMP_BY} ${TMP_OCT}.BY
grep_medical_cases_octave ${TMP_RU} ${TMP_OCT}.RU
grep_medical_cases_octave ${TMP_UA} ${TMP_OCT}.UA
#octave --persist --no-gui pl_sarscov2.m # debug
octave --no-gui pl_sarscov2.m
else
printf "${TMP_PL} or ${TMP_DE} or ... does not exist.\n"
printf "Try the 'w' parameter to download.\n"
fi
}
## parameter 'w' to 'wget' a fresh copy
if [ "x$1" = "xw" ]; then
do_download
russia_hack
fi
#This is to generate .svg plots.
plot_octave
#This is to generate data for using with mediawiki/lua {{Graph:Chart}}.
#plot_mediawiki
rm -f /tmp/tmpsemilog_pl.*
Octave script
[edit]This needs octave and should be named pl_sarscov2.m so that it can be called by the script above, pl_sarscov2.sh.
## pl_sarscov2 - Polish neighbourhood SARS-CoV-2 pandemic data
## (C) Wikimedia Commons User:Boud, 2020 CC-BY-SA-4.0
## https://creativecommons.org/licenses/by-sa/4.0/
## https://creativecommons.org/2015/10/08/cc-by-sa-4-0-now-one-way-compatible-with-gplv3/
## This component is a plotting script to be used by pl_sarscov2.sh .
graphics_toolkit gnuplot
## input filename template
infile = "/tmp/tmpsemilog_oct.data";
## Deaths + lab-confirmed cases for all Poland's neighbours is too much info.
global plot_deaths = 0
## Recoveries would be too much info for a single graph, but the info
## is (should be) available in the 'cases' table.
global plot_recoveries = 0
## choose daily increments instead of totals?
global daily = 0
global lang = "en" # default
## overrides
lang = "pl"
##lang = "fr" # default
## numerical dates "in March"; April = 32..61; May = 62...92; ...
## plot boundaries
global init_March = 2
global final_March = 34
global delta_date = 0.5 # for vertical axis labels
## xticklabel parameters
global init_March_lab = 2
global del_March = 7 # interval
global final_March_lab = 30
## exponential line
global extra_percent = [1.3];
global n1_extra_default = 50
global final_March_exponential = final_March-8
global March = 31
global April = 61
global May = 92
global n_min = 0.8
global n_max_tot = 1e5
global n_max_daily = 2e4
global j_tick1 = 0
global j_tick2 = 5
##dates_March = linspace(init_March,final_March,(final_March-4+1));
## other-EU; non-EU; PL
states = {"DE","CZ","SK","LT", "RU","BY","UA", "PL"};
switch (lang)
case "en"
states{length(states)+1} = "+30%/day";
case "pl"
states{length(states)+1} = " +30%/dz";
case "fr"
states{length(states)+1} = "+30%/j";
endswitch
switch (daily)
case 0
global n1_extra = n1_extra_default
otherwise
global n1_extra = 8
endswitch
line_colours = {[0.0 0.4 0.0],
[0.0 0.6 0.0],
[0.0 0.8 0.0],
[0.5 0.8 0.6]
,
[0.0 0.0 0.6],
[0.4 0.0 0.8],
[0.1 0.2 1.0]
,
[0.8 0.0 0.0]
,
[0 0 0],
[0 0 0]};
syms = {'s','s','s','s', 'd','d','d', 'o', '', ''};
n_states = 8;
n_extra = 1;
## initialise plot "figure" and "axes" objects and plotting parameters
plot([0 1],[0 1])
set(gcf(),"defaultlinelinewidth",10);
set(gcf(),"defaultlinemarkersize",4);
set(gcf(),"defaultaxesfontsize",10);
set(gcf(),"defaultaxeslinewidth",2);
set(gcf(),"defaulttextinterpreter",'tex');
for i_state=1:(n_states+n_extra)
if(i_state <= n_states)
cases = load([infile "." states{i_state}]);
if(daily)
n_rows = rows(cases);
c = cases(:,2) .- [0; cases(1:n_rows-1,2)];
cases(:,2) = c;
c = cases(:,3) .- [0; cases(1:n_rows-1,3)];
cases(:,3) = c;
c = cases(:,4) .- [0; cases(1:n_rows-1,4)];
cases(:,4) = c;
endif
switch (i_state)
case n_states
lw=6;
otherwise
lw=3;
endswitch
else
## n1, d2, delta_d are for this local block only
n1 = n1_extra;
d2 = final_March_exponential; # final date for exponential
delta_d = d2-init_March;
## two end points of norm * extra_percent^days
cases = [init_March n1 0 0;
d2 n1*extra_percent(1,i_state-n_states)^delta_d 0 0];
lw = 2;
endif
semilogy(cases(:,1), cases(:,2), ['-' syms{i_state}],
'linewidth',lw,
'color',line_colours{i_state}
)
if(i_state <= n_states)
states_lab{i_state} = [states{i_state} " "];
else
states_lab{i_state} = [states{i_state}];
endif
hold on
endfor
if(daily)
n_max = n_max_daily
else
n_max = n_max_tot
endif
axis([init_March final_March n_min n_max])
legend(states_lab{1:(n_states+n_extra)})
legend("boxoff")
set(legend,"location","northeast")
set(legend,"fontsize",11)
## set up x tick labels
i_labs = 0
for i_date=init_March_lab:del_March:final_March_lab
i_labs++;
xtick(i_labs) = i_date;
if(lang == "en")
if(i_date <= March)
s = sprintf("%d March",i_date);
elseif(i_date <= April)
s = sprintf("%d April",i_date);
elseif(i_date <= May)
s = sprintf("%d May",i_date);
else
printf("Please add June or later months.\n");
quit;
endif
elseif(lang == "pl")
if(i_date <= March)
s = sprintf("%d marca",i_date);
elseif(i_date <= April)
s = sprintf("%d kwietnia",i_date);
elseif(i_date <= May)
s = sprintf("%d maja",i_date);
else
printf("Please add June or later months.\n");
quit;
endif
elseif(lang == "fr")
if(i_date <= March)
s = sprintf("%d mars",i_date);
elseif(i_date <= April)
s = sprintf("%d avril",i_date);
elseif(i_date <= May)
s = sprintf("%d mai",i_date);
else
printf("Please add June or later months.\n");
quit;
endif
endif
xticklabel{i_labs} = s;
endfor
set(gca(),'xtick',xtick)
set(gca(),'xticklabel',xticklabel)
## set up y tick labels
j_labs = 0
for j_tick=j_tick1:j_tick2
j_labs++;
yticklabel{j_labs} = sprintf("%d",10^j_tick);
ytick(j_labs) = 10^j_tick;
endfor
set(gca(),'ytick',ytick)
set(gca(),'yticklabel',yticklabel)
grid on
if(plot_deaths)
for i_state=1:n_states
cases = load(["/tmp/tmpsemilog_oct.data." states{i_state}]);
switch (i_state)
case n_states
lw=6;
otherwise
lw=3;
endswitch
semilogy(cases(:,1), cases(:,3), 'x',
'linewidth',lw,
'color',line_colours{i_state})
endfor
endif
if(lang == "en")
xlabel('date in 2020')
if(daily)
ylabel('daily new cases')
else
ylabel('total count')
endif
title('SARS-CoV-2 lab-confirmed cases in and around Poland')
elseif(lang == "pl")
xlabel('data w 2020 r.')
if(daily)
ylabel('liczba dzienne')
else
ylabel('liczba narastająca')
endif
title('Liczba zakażeń SARS-CoV-2 w Polsce i u sąsiadów')
elseif(lang == "fr")
xlabel('date en 2020')
if(daily)
ylabel('nouveaux cas par jour')
else
ylabel('nombre cumulatif')
endif
title("Nombre d'infections par SARS-CoV-2 en Pologne et chez les pays voisins")
endif
print(['SARS-CoV-2_infections_in_and_around_Poland_' lang '.svg'],'-dsvg')
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 11:36, 26 March 2020 | 512 × 384 (39 KB) | Boud (talk | contribs) | updates 25 March, a few early 26 March data | |
15:49, 23 March 2020 | 512 × 384 (37 KB) | Boud (talk | contribs) | "30 March" was missing from the horizontal axis | ||
15:46, 23 March 2020 | 512 × 384 (36 KB) | Boud (talk | contribs) | update for values so far on 23 March; smaller diamond sizes | ||
22:07, 21 March 2020 | 512 × 384 (35 KB) | Boud (talk | contribs) | PL still slightly below 1.3^d exponential growth rate; CZ seems to have a weakening growth rate; no sign of DE dropping below 1.3^d. | ||
22:15, 20 March 2020 | 512 × 384 (33 KB) | Boud (talk | contribs) | updates 20 March: hint of decreasing semilog slope for PL; SK slope weakening; CZ hint of decreasing slope; DE no hint of getting into control - factor of 10 increase in 9 days implies 100,000 SARS-CoV-2 cases in DE around 27 March; LT + UA low but strong exponential growth. | ||
09:47, 20 March 2020 | 512 × 384 (33 KB) | Boud (talk | contribs) | 20 March early updates: DE data seem to be for previous day - seems to be OK since it's consistent; DE, UA, BY clearly still growing at exponentials with unchanged doubling times; UA faster than the default exponential of 1.3^d; PL, CZ only show early morning values for 20 March | ||
00:14, 20 March 2020 | 512 × 384 (32 KB) | Boud (talk | contribs) | UA 19 March | ||
20:34, 19 March 2020 | 512 × 384 (32 KB) | Boud (talk | contribs) | clearer label for +30%/day | ||
20:16, 19 March 2020 | 512 × 384 (32 KB) | Boud (talk | contribs) | updates for 19 March evening; added an exponential for 30% increase/day | ||
13:07, 19 March 2020 | 512 × 384 (31 KB) | Boud (talk | contribs) | s/LI/LT/ |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Short title | Gnuplot |
---|---|
Image title | Produced by GNUPLOT 5.0 patchlevel 5 |
Width | 100% |
Height | 100% |