diff --git a/.gitignore b/.gitignore index 82248b0..9bb88d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -plots/ /.DS_Store diff --git a/DATOS COVID 1:04:2020.xlsx b/DATOS COVID 1:04:2020.xlsx deleted file mode 100644 index 4eb15c4..0000000 Binary files a/DATOS COVID 1:04:2020.xlsx and /dev/null differ diff --git a/plots/.DS_Store b/plots/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/plots/.DS_Store differ diff --git a/plots/covid-numbers.numbers b/plots/covid-numbers.numbers new file mode 100755 index 0000000..b2dc447 Binary files /dev/null and b/plots/covid-numbers.numbers differ diff --git a/plots/factor-mexico.gp b/plots/factor-mexico.gp new file mode 100644 index 0000000..e7200bd --- /dev/null +++ b/plots/factor-mexico.gp @@ -0,0 +1,15 @@ +clear +set datafile separator "," +set datafile missing "NaN" +file="../datos/datos-covid-mexico.csv" +set linestyle 1 lc rgb 'black' pt 6 ps 2 # circle +set linestyle 2 lt 0 lw 3.3 +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Factor de crecimiento' font ',14' +set title 'Figura 4: Factor de crecimeinto díario de COVID19 en México' font ',18' +show title +set key off +plot [1:][] file using 2:4 w lp ls 1 \ No newline at end of file diff --git a/plots/factor-michoacan.gp b/plots/factor-michoacan.gp new file mode 100644 index 0000000..894c431 --- /dev/null +++ b/plots/factor-michoacan.gp @@ -0,0 +1,15 @@ +clear +set datafile separator "," +set datafile missing "NaN" +file="../datos/datos-covid-michoacan.csv" +set linestyle 1 lc rgb 'black' pt 6 ps 2 # circle +set linestyle 2 lt 0 lw 3.3 +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Factor de crecimiento' font ',14' +set title 'Figura 7: Factor de crecimeinto díario de COVID19 en Michoacán' font ',18' +show title +set key off +plot [1:][] file using 2:6 w lp ls 1 \ No newline at end of file diff --git a/plots/fig-gen.bk b/plots/fig-gen.bk new file mode 100644 index 0000000..73387a2 --- /dev/null +++ b/plots/fig-gen.bk @@ -0,0 +1,147 @@ +# Preparing data +clear +reset +set datafile separator "," +set datafile missing "NaN" +set bmargin at screen 0.15 +set lmargin at screen 0.15 +file="../datos/datos-covid-mexico.csv" +set linestyle 1 lc rgb 'black' pt 6 ps 2 # circle +set linestyle 2 lt 0 lw 3.3 +FIT_LIMIT = 1e-6 +# 1 Expo +set terminal png +set output "1-1.png" +f(x) = a*exp(b*x) +fit f(x) file using 2:3 via a,b +set xlabel 'Días de Contagio' font ',12' +set xtics font ", 11" +show xlabel +set ytics font ", 11" +set ylabel 'Casos Confirmados' font ',14' +set label sprintf("f(x)=%f*e(%f*x)", a, b) at graph 0.01,0.85 font ',12' +set title 'Figura 1: Modelo Exponencial.' font ',16' +show title +set key left top font ',10' box 3 +plot [1:][]file using 2:3 title 'Casos' w p ls 1, \ + f(x) with lines ls 2 title 'Exponencial' +set output +unset output +unset label +# 2 Polinomico +FIT_LIMIT = 1e-6 +f(x) = a*x*x+b*x+c +fit f(x) file using 2:3 via a,b,c +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Casos confirmados' font ',14' +set label sprintf("f(x)=%f*x^2-%f*x+%f", a, b, c) at graph 0.01,0.85 font ',12' +set title 'Figura 2: Modelo polinomial' font ',16' +show title +set key left top font ',10' box 3 +plot file using 2:3 title 'Casos' w p ls 1, \ + f(x) with lines ls 2 title 'Polinomial' +set output "1-2.png" +replot +unset output +unset label +# Logaritmico +clear +set datafile separator "," +set datafile missing "NaN" +file="../datos/datos-covid-mexico.csv" +set linestyle 1 lc rgb 'black' pt 6 ps 2 # circle +set linestyle 2 lt 0 lw 3.3 +FIT_LIMIT = 1e-6 +f(x) = a*x+b +fit f(x) file using 2:9 via a, b +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Casos confirmados' font ',14' +set label sprintf("log(f(x))=%f*x+%f", a, b) at graph 0.01,0.85 font ',12' +set title 'Figura 3: Modelo logarítmico' font ',16' +show title +set key left top font ',10' box 3 +plot file using 2:(log($3)) title 'Casos' w p ls 1, \ + f(x) with lines ls 2 title 'Log' +set output "1-3.png" +replot +unset output +unset label +# 4 Factor de crecimiento mexico +clear +set linestyle 1 lc rgb 'black' pt 6 ps 2 # circle +set linestyle 2 lt 0 lw 3.3 +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Factor de crecimiento' font ',14' +set title 'Figura 4: Factor de crecimeinto díario de COVID19 en México' font ',14' +show title +set key off +plot [1:][] file using 2:4 w lp ls 1 +set output "1-4.png" +replot +unset output +unset label +# Incremento diario +clear +reset +FIT_LIMIT = 1e-6 +g(x) = c*exp(d*x) +fit g(x) file using 2:6 via c, d +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Incremento de casos diario' font ',14' +set label sprintf("f(x)=%+-f*x%+-f", a, b) at graph 0.01,0.85 font ',12' +set title 'Figura 5: Modelo lineal para incrmento de los casos diarios en México' font ',14' +show title +set key left top font ',10' box 3 +plot file using 2:6 title 'Incremento' w lp ls 1, \ + g(x) with lines ls 2 title 'Regresor' +set output "1-5.png" +replot +unset output +unset label +# 6 Modelo lineal Michoacan +clear +file2="../datos/datos-covid-michoacan.csv" +f(x) = a*x+b +fit f(x) file2 using 2:3 via a, b +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Casos confirmados' font ',14' +set label sprintf("f(x)=%+-f*x%+-f", a, b) at graph 0.01,0.85 font ',12' +set title 'Figura 6: Modelo lineal para los casos en Michoacán' font ',14' +show title +set key left top font ',10' box 3 +plot file2 using 2:3 title 'Casos' w p ls 1, \ + f(x) with lines ls 2 title 'Modelo' +set output "1-6.png" +replot +unset output +unset label + +# Factor de crecimiento Michoacan +clear +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Factor de crecimiento' font ',14' +set title 'Figura 7: Factor de crecimeinto díario de COVID19 en Michoacán' font ',14' +show title +set key off +plot [1:][] file2 using 2:6 w lp ls 1 +set output "1-7.png" +replot +unset output +unset label diff --git a/plots/fig-gen.gp b/plots/fig-gen.gp new file mode 100644 index 0000000..16f4701 --- /dev/null +++ b/plots/fig-gen.gp @@ -0,0 +1,140 @@ +# Preparing data +clear +reset +set datafile separator "," +set datafile missing "NaN" +set bmargin at screen 0.15 +set lmargin at screen 0.15 +file="../datos/datos-covid-mexico.csv" +set linestyle 1 lc rgb 'black' pt 6 ps 2 # circle +set linestyle 2 lt 0 lw 3.3 +FIT_LIMIT = 1e-6 +# 1 Expo +set terminal png +set output "1-1.png" +f(x) = a*exp(b*x) +fit f(x) file using 2:3 via a,b +set xlabel 'Días de Contagio' font ',12' +set xtics font ", 11" +show xlabel +set ytics font ", 11" +set ylabel 'Casos Confirmados' font ',14' +set label sprintf("f(x)=%f*e(%f*x)", a, b) at graph 0.01,0.85 font ',12' +set title 'Figura 1: Modelo Exponencial.' font ',16' +show title +set key left top font ',10' box 3 +plot [1:][]file using 2:3 title 'Casos' w p ls 1, \ + f(x) with lines ls 2 title 'Exponencial' +set output +unset output +unset label +# 2 Polinomico +clear +set output "1-2.png" +f(x) = a*x*x+b*x+c +fit f(x) file using 2:3 via a,b,c +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Casos confirmados' font ',14' +set label sprintf("f(x)=%f*x^2-%f*x+%f", a, b, c) at graph 0.01,0.85 font ',12' +set title 'Figura 2: Modelo polinomial' font ',16' +show title +set key left top font ',10' box 3 +plot file using 2:3 title 'Casos' w p ls 1, \ + f(x) with lines ls 2 title 'Polinomial' +set output +unset output +unset label +# 3 Logaritmico +clear +set output "1-3.png" +f(x) = a*x+b +fit f(x) file using 2:9 via a, b +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Casos confirmados' font ',14' +set label sprintf("log(f(x))=%f*x+%f", a, b) at graph 0.01,0.85 font ',12' +set title 'Figura 3: Modelo logarítmico' font ',16' +show title +set key left top font ',10' box 3 +plot file using 2:(log($3)) title 'Casos' w p ls 1, \ + f(x) with lines ls 2 title 'Log' +set output +unset output +unset label +# 4 Factor de crecimiento mexico +clear +set output "1-4.png" +set linestyle 1 lc rgb 'black' pt 6 ps 2 # circle +set linestyle 2 lt 0 lw 3.3 +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Factor de crecimiento' font ',14' +set title 'Figura 4: Factor de crecimeinto díario de COVID19 en México' font ',14' +show title +set key off +plot [1:][] file using 2:4 w lp ls 1 +set output +unset output +unset label +# 5 Incremento diario +clear +set output "1-5.png" +f(x) = a*exp(b*x) +g(x) = c*exp(d*x) +fit g(x) file using 2:6 via c, d +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Incremento de casos diario' font ',14' +set label sprintf("f(x)=%+-f*exp(%+-f*x)", c, d) at graph 0.01,0.85 font ',12' +set title 'Figura 5: Modelo lineal para incrmento de los casos diarios en México' font ',14' +show title +set key left top font ',10' box 3 +plot file using 2:6 title 'Incremento' w lp ls 1, \ + g(x) with lines ls 2 title 'Regresor' +set output +unset output +unset label +# 6 Modelo lineal Michoacan +clear +file2="../datos/datos-covid-michoacan.csv" +set output "1-6.png" +f(x) = a*x+b +fit f(x) file2 using 2:3 via a, b +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Casos confirmados' font ',14' +set label sprintf("f(x)=%+-f*x%+-f", a, b) at graph 0.01,0.85 font ',12' +set title 'Figura 6: Modelo lineal para los casos en Michoacán' font ',14' +show title +set key left top font ',10' box 3 +plot file2 using 2:3 title 'Casos' w p ls 1, \ + f(x) with lines ls 2 title 'Modelo' +set output +unset output +unset label + +# Factor de crecimiento Michoacan +clear +set output "1-7.png" +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Factor de crecimiento' font ',14' +set title 'Figura 7: Factor de crecimeinto díario de COVID19 en Michoacán' font ',14' +show title +set key off +plot [1:][] file2 using 2:6 w lp ls 1 +set output +unset output +unset label diff --git a/plots/figura1.gp b/plots/figura1.gp new file mode 100644 index 0000000..6cab192 --- /dev/null +++ b/plots/figura1.gp @@ -0,0 +1,29 @@ +# Preparing data +clear +reset +set datafile separator "," +set datafile missing "NaN" +set bmargin at screen 0.15 +set lmargin at screen 0.15 +file="../datos/datos-inicio-mexico.csv" +set linestyle 1 lc rgb 'black' pt 6 ps 2 # circle +set linestyle 2 lt 0 lw 3.3 +# 1 Expo +set terminal png +set output "1-1.png" +f(x) = c*exp(d*x) +fit f(x) file using 2:3 via c, d +set xlabel 'Días de Contagio' font ',12' +set xtics font ", 11" +show xlabel +set ytics font ", 11" +set ylabel 'Casos Confirmados' font ',14' +set label sprintf("f(x)=%f*e(%f*x)", c, d) at graph 0.01,0.85 font ',12' +set title 'Figura 1: Modelo Exponencial.' font ',16' +show title +set key left top font ',10' box 3 +plot file using 2:3 title 'Casos' w p ls 1, \ + f(x) with lines ls 2 title 'Exponencial' +set output +unset output +unset label diff --git a/plots/figura5.gp b/plots/figura5.gp new file mode 100644 index 0000000..d88c5c1 --- /dev/null +++ b/plots/figura5.gp @@ -0,0 +1,31 @@ +# Preparing data +#clear +#reset +set terminal png +set datafile separator "," +set datafile missing "NaN" +set bmargin at screen 0.15 +set lmargin at screen 0.15 +file="../datos/datos-covid-mexico.csv" +set linestyle 1 lc rgb 'black' pt 6 ps 2 # circle +set linestyle 2 lt 0 lw 3.3 +FIT_LIMIT = 1e-6 +# 5 Incremento diario +#clear +set output "1-5.png" +g(x) = c*exp(d*x) +fit g(x) file using 2:6 via c, d +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Incremento de casos diario' font ',14' +set label sprintf("f(x)=%+-f*exp(%+-f*x)", c, d) at graph 0.01,0.85 font ',12' +set title 'Figura 5: Modelo exponencial para incrmento de los casos diarios en México' font ',14' +show title +set key left top font ',10' box 3 +plot file using 2:6 title 'Incremento' w lp ls 1, \ + g(x) with lines ls 2 title 'Regresor' +set output +unset output +unset label diff --git a/plots/figura8.gp b/plots/figura8.gp new file mode 100644 index 0000000..1a38a49 --- /dev/null +++ b/plots/figura8.gp @@ -0,0 +1,31 @@ +# Preparing data +#clear +#reset +set terminal png +set datafile separator "," +set datafile missing "NaN" +set bmargin at screen 0.15 +set lmargin at screen 0.15 +file="../datos/datos-covid-mexico.csv" +set linestyle 1 lc rgb 'black' pt 6 ps 2 # circle +set linestyle 2 lt 0 lw 3.3 +FIT_LIMIT = 1e-6 +# 5 Incremento diario +#clear +set output "1-8.png" +g(x) = c*exp(d*x) +fit g(x) file using 2:12 via c, d +set xlabel 'Días de contagio' font ',14' +set xtics font ", 13" +show xlabel +set ytics font ", 11" +set ylabel 'Incremento de muertes diarias' font ',14' +set label sprintf("f(x)=%+-f*exp(%+-f*x)", c, d) at graph 0.01,0.85 font ',12' +set title 'Figura 8: Modelo para el número de muertes diarias en México' font ',14' +show title +set key left top font ',10' box 3 +plot file using 2:12 title 'Incremento' w lp ls 1, \ + g(x) with lines ls 2 title 'Regresor' +set output +unset output +unset label \ No newline at end of file