File:2021.12.07.CovidPolandWd.png
Jump to navigation
Jump to search
Size of this preview: 800 × 496 pixels. Other resolutions: 320 × 198 pixels | 1,691 × 1,048 pixels.
Original file (1,691 × 1,048 pixels, file size: 176 KB, MIME type: image/png)
Summary
Covid death tall in Poland versus time by Worldindata [1], black curve, and the three approximations:
\( f(t)= c\, t^3 \)
where \( t\) is time measured in years (1 year=265.25 days)
and values of \( c \) are
30000,
sqrt(3)*10000,
10000.
Generator
Data should be loaded from Worldindata <ref name="o">.
The input table can be generated with command
grep Poland ../owid-covid-data.csv |cut -d, -f 3,4,8,9 > Poland2.txt
Then, the picture can be generated with code below
<!DOCTRINE html><html><body><small><small><small><small> <?php $j0=juliantojd(1, 1, 2020); for($T=0;$T<1001;$T++) $P[$T]=0; $myfile = fopen("Poland2.txt", "r") or die("Unable to open file!"); for($i=0;$i<1001;$i++){ $g=fgets($myfile); $h=explode(",",trim($g)); $s=count($h); if($s<2) break; $s=strlen($h[2]); $f=explode("-",$h[1]); $j=juliantojd($f[1], $f[2], $f[0]); if($s>1){ $T=$j-$j0; // echo "$h[1] $t $h[2] "; $u=sscanf($h[2],"%d"); $v=$u[0]; // echo $v,"<br>\n"; $P[$T]=$v; } } fclose($myfile); $U=$T+1; echo "Poland death tall for U=$U days<br>"; // for($T=0;$T<$U;$T++) { echo "$T,$P[$T] <br>" ;} echo "<svg width='852'; height='540';>"; #echo "<image x='27' y='10' preserveAspectRatio='none' width='728' height='420' xlink:href='2021.12.06.CovidRussiaWd.png'/>"; $L=32; $B=520; for($y=0;$y<501;$y+=50){$x1=$L+0; $x2=$L+800; $Y=$B-$y; echo "<line x1=$x1 y1=$Y x2=$x2 y2=$Y stroke='black' stroke-width='.6'/>\n";} $y=500; $Y=$B+4-$y; echo "<text text-anchor='end' transform='translate(30,$Y)'>100k </text> \n"; $y=400; $Y=$B+4-$y; echo "<text text-anchor='end' transform='translate(30,$Y)'> 80k </text> \n"; $y=300; $Y=$B+4-$y; echo "<text text-anchor='end' transform='translate(30,$Y)'> 60k </text> \n"; $y=200; $Y=$B+4-$y; echo "<text text-anchor='end' transform='translate(30,$Y)'> 40k </text> \n"; $y=100; $Y=$B+4-$y; echo "<text text-anchor='end' transform='translate(30,$Y)'> 20k </text> \n"; $y=0 ; $Y=$B+4-$y; echo "<text text-anchor='end' transform='translate(24,$Y)'> 0 </text> \n"; for($t=0;$t<4;$t++){ $T=365.25*$t; $X=$L+$T; echo "<line x1=$X y1=$B x2=$X y2=0 stroke='RGB(0,255,0)' stroke-width='2'/>\n"; } for($T=0;$T<801;$T+=10){$X=$L+$T; $Y1=$B; $Y2=$B-500; echo "<line x1=$X y1=$Y1 x2=$X y2=$Y2 stroke='black' stroke-width='.5'/>\n"; } $B4=$B+4; for($T=0;$T<801;$T+=50){$X=$L+$T; $X1=$L+$T+1; $Xp=$X+5; $j=$j0+$T; $d0=jdtojulian($j); $d1=explode("/",$d0); $text=sprintf("%04d.%02d.%02d",$d1[2],$d1[0],$d1[1]); $tex=sprintf("%d",$T); $B1=$B-40; $B2=$B+14; echo "<line x1=$X y1=30 x2=$X y2=$B4 stroke='RGB(255,0,255)' stroke-width='.9' />\n"; echo "<text text-anchor='middle' transform='translate($Xp,$B1) rotate(-90)'>$text</text> \n"; echo "<text text-anchor='middle' transform='translate($X1,$B2)'>$tex</text> \n"; } echo "<polyline points='\n"; for($T=0;$T<$U;$T++) { $X=$L+$T; $Y=$B - 0.005 * $P[$T]; echo "$X,$Y "; } echo "'"; echo " style='fill:none;stroke:#000;stroke-width:1.6' /> \n"; echo "<polyline points='\n"; for($T=0;$T<811;$T++) { $X=$L+$T; $t=$T/365.25; $Y=$B - 0.005 *30000*$t*$t*$t; echo "$X,$Y "; } echo "'"; echo " style='fill:none;stroke:#f00;stroke-width:1' /> \n"; echo "<polyline points='\n"; for($T=0;$T<811;$T++) { $X=$L+$T; $t=$T/365.25; $Y=$B - 0.005 *sqrt(3)*10000*$t*$t*$t; echo "$X,$Y "; } echo "'"; echo " style='fill:none;stroke:#0a0;stroke-width:1' /> \n"; echo "<polyline points='\n"; for($T=0;$T<811;$T++) { $X=$L+$T; $t=$T/365.25; $Y=$B - 0.005 *10000*$t*$t*$t; echo "$X,$Y "; } echo "'"; echo " style='fill:none;stroke:#00f;stroke-width:1' /> \n"; echo "</svg>"; echo "</small>\n"; ?> </body> </html>
References
- ↑ https://covid.ourworldindata.org/data/owid-covid-data.csv 2021 Dec 5 12:23
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 22:29, 7 December 2021 | 1,691 × 1,048 (176 KB) | T (talk | contribs) | <div style="margin:0px -14px 0px -200px; background-color:#fff"> <div style="margin:0px 0px 0px 30px; line-height:1.2em"> Covid death tall in Poland versus time by Worldindata <ref name="o"> https://covid.ourworldindata.org/data/owid-covid-data... |
You cannot overwrite this file.
File usage
There are no pages that use this file.