diff --git a/.github/workflows/quarto-book-macos.yaml b/.github/workflows/quarto-book-macos.yaml index 4f6dad30..eb33bcf9 100644 --- a/.github/workflows/quarto-book-macos.yaml +++ b/.github/workflows/quarto-book-macos.yaml @@ -4,6 +4,10 @@ on: pull_request: branches: main +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + name: Book-MacOS jobs: @@ -25,7 +29,6 @@ jobs: with: use-public-rspm: true r-version: '4.3.3' - extra-repositories: 'https://grantmcdermott.r-universe.dev' - uses: r-lib/actions/setup-r-dependencies@v2 @@ -69,10 +72,6 @@ jobs: tikzDevice::tikzTest("$\\sin(x^2/2 - y^2/4 + 3) \\cos(2 x + 1 - \\exp(y))$") shell: Rscript {0} - - name: Reinstall R packages from source - run: | - install.packages(c("Matrix", "MatrixModels", "rjags", "lme4", "TMB", "glmmTMB"), repos = "https://cran.r-project.org/", type = "source") - shell: Rscript {0} - name: Render Book run: | diff --git a/.github/workflows/quarto-book-ubuntu.yaml b/.github/workflows/quarto-book-ubuntu.yaml index faf139be..73c036e9 100644 --- a/.github/workflows/quarto-book-ubuntu.yaml +++ b/.github/workflows/quarto-book-ubuntu.yaml @@ -4,6 +4,11 @@ on: pull_request: branches: main +# https://github.com/dmlc/xgboost/commit/bc516198dccd9fb345ac318c56ee7bb48bba5aae +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + name: Book-Ubuntu jobs: @@ -25,7 +30,6 @@ jobs: with: use-public-rspm: true r-version: '4.3.3' - extra-repositories: 'https://grantmcdermott.r-universe.dev' - uses: r-lib/actions/setup-r-dependencies@v2 @@ -67,10 +71,6 @@ jobs: tikzDevice::tikzTest("$\\sin(x^2/2 - y^2/4 + 3) \\cos(2 x + 1 - \\exp(y))$") shell: Rscript {0} - - name: Reinstall R packages from source - run: | - install.packages(c("Matrix", "MatrixModels", "rjags", "lme4", "TMB", "glmmTMB"), repos = "https://cran.r-project.org/", type = "source") - shell: Rscript {0} - name: Setup magick run: | diff --git a/DESCRIPTION b/DESCRIPTION index 3ee21ce1..6ce59a42 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,7 +11,6 @@ Depends: R (>= 4.3.0) Imports: BB, - beanplot, broom, car, coin, @@ -30,25 +29,12 @@ Imports: gifski, ggalluvial, gganimate (>= 1.0.9), - ggbeeswarm, - ggbump, - ggdensity, - ggeffects, - ggExtra, - ggforce, ggfortify, - ggmosaic, - ggnewscale, ggplot2 (>= 3.5.0), ggraph (>= 2.2.0), ggrepel, ggridges, - ggsignif, - ggstats (>= 0.5.0), - ggstream, - ggthemes (>= 5.0.0), - ggTimeSeries, - ggVennDiagram, + ggstats, ggwordcloud, glmnet, gt (>= 0.10.1), @@ -83,30 +69,24 @@ Imports: RSQLite, scs, showtext, + shiny, spacyr, text2vec, tidygraph, - tinyplot, titanic, tikzDevice, treemapify, TSP, vcd, - vioplot, visNetwork, webshot2, xml2, xts -Remotes: - davidsjoberg/ggbump, - davidsjoberg/ggstream Suggests: quarto (>= 1.2), rsconnect (>= 1.1.0) Enhances: sp (>= 2.0-0) SystemRequirements: pgf (>= 3.00) -Additional_repositories: - https://grantmcdermott.r-universe.dev Encoding: UTF-8 License: CC NC ND 4.0 diff --git a/README.md b/README.md index 7fd6ae60..75c0d137 100755 --- a/README.md +++ b/README.md @@ -4,14 +4,6 @@ 本仓库作为《R 语言数据分析实战》书稿源码的托管地址。目前内容较多的章节有 -- 数据探索 - - ggplot2 入门 - - 基础图形 - - 统计图形 - - lattice 入门 - - graphics 入门 - - TikZ 入门 - - 探索实践 - 数据交流 - 交互图形 - 交互表格 @@ -107,35 +99,30 @@ Running under: macOS Sonoma 14.3.1, RStudio 2023.12.1.402 Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8 Package version: - BB_2019.10.1 beanplot_1.3.1 broom_1.0.5 - car_3.1.2 coin_1.4.3 data.table_1.15.2 - datasauRus_0.1.8 dbplyr_2.4.0 downlit_0.4.3 - dplyr_1.1.4 DT_0.32 dunn.test_1.3.5 - dygraphs_1.1.1.6 e1071_1.7.14 ECOSolveR_0.5.5 - GA_3.2.4 ggalluvial_0.12.5 gganimate_1.0.9 - ggbeeswarm_0.7.2 ggbump_0.1.99999 ggdensity_1.0.0 - ggeffects_1.5.0 ggExtra_0.10.1 ggforce_0.4.2 - ggfortify_0.4.16 ggmosaic_0.3.3 ggnewscale_0.4.10 - ggplot2_3.5.0 ggraph_2.2.0 ggrepel_0.9.5 - ggridges_0.5.6 ggsignif_0.6.4 ggstats_0.5.1 - ggstream_0.1.0 ggthemes_5.1.0 ggTimeSeries_1.0.2 - ggVennDiagram_1.5.2 ggwordcloud_0.6.1 gifski_1.12.0.2 - gt_0.10.1 hexbin_1.28.3 HistData_0.9.1 - jiebaR_0.11 kernlab_0.9.32 knitr_1.45 - latticeExtra_0.6.30 lvplot_0.2.1 magick_2.8.3 - maps_3.4.2 misc3d_0.9.1 nloptr_2.0.3 - nomnoml_0.3.0 patchwork_1.2.0 pdftools_3.4.0 - plot3D_1.4.1 plotly_4.10.4 pROC_1.18.5 - purrr_1.0.2 pwr_1.3.0 quadprog_1.5.8 - quantmod_0.4.26 ragg_1.2.7 ROI_1.0.1 - ROI.plugin.ecos_1.0.2 ROI.plugin.glpk_1.0.0 ROI.plugin.nloptr_1.0.1 - ROI.plugin.quadprog_1.0.1 ROI.plugin.scs_1.1.2 rootSolve_1.8.2.4 - RSQLite_2.3.5 scs_3.2.4 showtext_0.9.7 - spacyr_1.3.0 text2vec_0.6.4 tidygraph_1.3.1 - tikzDevice_0.12.6 tinyplot_0.0.5.9000 titanic_0.1.0 + BB_2019.10.1 broom_1.0.5 car_3.1.2 + coin_1.4.3 data.table_1.15.2 datasauRus_0.1.8 + dbplyr_2.4.0 downlit_0.4.3 dplyr_1.1.4 + DT_0.32 dunn.test_1.3.5 dygraphs_1.1.1.6 + e1071_1.7.14 ECOSolveR_0.5.5 GA_3.2.4 + ggalluvial_0.12.5 gganimate_1.0.9 ggfortify_0.4.16 + ggplot2_3.5.0 ggraph_2.2.1 ggrepel_0.9.5 + ggridges_0.5.6 ggwordcloud_0.6.1 gifski_1.12.0.2 + glmnet_4.1.8 gt_0.10.1 hexbin_1.28.3 + HistData_0.9.1 jiebaR_0.11 kernlab_0.9.32 + knitr_1.45 latticeExtra_0.6.30 lvplot_0.2.1 + magick_2.8.3 maps_3.4.2 misc3d_0.9.1 + nloptr_2.0.3 nomnoml_0.3.0 patchwork_1.2.0 + pdftools_3.4.0 plot3D_1.4.1 plotly_4.10.4 + pROC_1.18.5 purrr_1.0.2 pwr_1.3.0 + quadprog_1.5.8 quantmod_0.4.26 ragg_1.2.7 + ROI_1.0.1 ROI.plugin.ecos_1.0.2 ROI.plugin.glpk_1.0.0 + ROI.plugin.nloptr_1.0.1 ROI.plugin.quadprog_1.0.1 ROI.plugin.scs_1.1.2 + rootSolve_1.8.2.4 RSQLite_2.3.5 scs_3.2.4 + showtext_0.9.7 spacyr_1.3.0 text2vec_0.6.4 + tidygraph_1.3.1 tikzDevice_0.12.6 titanic_0.1.0 treemapify_2.5.6 TSP_1.2.4 vcd_1.4.12 - vioplot_0.4.0 visNetwork_2.1.2 webshot2_0.1.1 - xml2_1.3.6 xts_0.13.2 + visNetwork_2.1.2 webshot2_0.1.1 xml2_1.3.6 + xts_0.13.2 ``` diff --git a/_quarto.yml b/_quarto.yml index 80470ef1..8bbcdffb 100755 --- a/_quarto.yml +++ b/_quarto.yml @@ -35,15 +35,6 @@ book: - wrangling-cleaning.qmd - wrangling-manipulation.qmd - wrangling-processing.qmd - - part: "数据探索" - chapters: - - visualization-basic.qmd - - visualization-intermediate.qmd - - visualization-advanced.qmd - - visualization-lattice.qmd - - visualization-graphics.qmd - - visualization-tikz.qmd - - visualization-practice.qmd - part: "数据交流" chapters: - interactive-graphics.qmd diff --git a/data/MathAnxiety.rds b/data/MathAnxiety.rds deleted file mode 100644 index 68fcbffe..00000000 Binary files a/data/MathAnxiety.rds and /dev/null differ diff --git a/data/china-age-sex-2020.rds b/data/china-age-sex-2020.rds deleted file mode 100755 index d168666b..00000000 Binary files a/data/china-age-sex-2020.rds and /dev/null differ diff --git a/data/china-household-sex-2020.rds b/data/china-household-sex-2020.rds deleted file mode 100755 index 5cd8e6c0..00000000 Binary files a/data/china-household-sex-2020.rds and /dev/null differ diff --git a/data/china-raise-illiteracy-2020.rds b/data/china-raise-illiteracy-2020.rds deleted file mode 100755 index fcfa2482..00000000 Binary files a/data/china-raise-illiteracy-2020.rds and /dev/null differ diff --git a/data/china-sex-ratio-2020.rds b/data/china-sex-ratio-2020.rds deleted file mode 100755 index 7c1d74cb..00000000 Binary files a/data/china-sex-ratio-2020.rds and /dev/null differ diff --git a/data/contributions.json b/data/contributions.json deleted file mode 100755 index 56fbc1e9..00000000 --- a/data/contributions.json +++ /dev/null @@ -1 +0,0 @@ -{"years":[{"year":"2023","total":30,"range":{"start":"2023-01-01","end":"2023-12-31"}},{"year":"2022","total":611,"range":{"start":"2022-01-01","end":"2022-12-31"}},{"year":"2021","total":625,"range":{"start":"2021-01-01","end":"2021-12-31"}},{"year":"2020","total":797,"range":{"start":"2020-01-01","end":"2020-12-31"}},{"year":"2019","total":409,"range":{"start":"2019-01-01","end":"2019-12-31"}},{"year":"2018","total":1109,"range":{"start":"2018-01-01","end":"2018-12-31"}},{"year":"2017","total":70,"range":{"start":"2017-01-01","end":"2017-12-31"}},{"year":"2016","total":1,"range":{"start":"2016-01-01","end":"2016-12-31"}},{"year":"2015","total":1,"range":{"start":"2015-01-01","end":"2015-12-31"}}],"contributions":[{"date":"2023-12-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-12-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-11-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-10-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-09-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-08-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-07-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-06-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-05-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-04-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-03-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-02-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-11","count":3,"color":"#30a14e","intensity":"3"},{"date":"2023-01-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-08","count":5,"color":"#216e39","intensity":"4"},{"date":"2023-01-07","count":3,"color":"#30a14e","intensity":"3"},{"date":"2023-01-06","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2023-01-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2023-01-04","count":2,"color":"#40c463","intensity":"2"},{"date":"2023-01-03","count":5,"color":"#216e39","intensity":"4"},{"date":"2023-01-02","count":10,"color":"#216e39","intensity":"4"},{"date":"2023-01-01","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-12-31","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-12-30","count":6,"color":"#30a14e","intensity":"3"},{"date":"2022-12-29","count":20,"color":"#216e39","intensity":"4"},{"date":"2022-12-28","count":7,"color":"#30a14e","intensity":"3"},{"date":"2022-12-27","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-12-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-24","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-12-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-21","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-12-20","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-12-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-10","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-12-09","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-12-08","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-12-07","count":6,"color":"#30a14e","intensity":"3"},{"date":"2022-12-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-12-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-30","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-11-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-28","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-11-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-26","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-11-25","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-11-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-23","count":6,"color":"#30a14e","intensity":"3"},{"date":"2022-11-22","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-11-21","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-11-20","count":7,"color":"#30a14e","intensity":"3"},{"date":"2022-11-19","count":7,"color":"#30a14e","intensity":"3"},{"date":"2022-11-18","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-11-17","count":5,"color":"#40c463","intensity":"2"},{"date":"2022-11-16","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-11-15","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-11-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-13","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-11-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-08","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-11-07","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-11-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-11-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-10-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-10-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-10-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-10-28","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-10-27","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-10-26","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-10-25","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-10-24","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-10-23","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-10-22","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-10-21","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-10-20","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-10-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-10-18","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-10-17","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-10-16","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-10-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-10-14","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-10-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-10-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-10-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-10-10","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-10-09","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-10-08","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-10-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-10-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-10-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-10-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-10-03","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-10-02","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-10-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-30","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-29","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-28","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-25","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-24","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-23","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-22","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-18","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-15","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-11","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-09","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-08","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-06","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-09-03","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-02","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-09-01","count":5,"color":"#40c463","intensity":"2"},{"date":"2022-08-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-08-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-08-29","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-08-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-08-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-08-26","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-08-25","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-08-24","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-08-23","count":5,"color":"#40c463","intensity":"2"},{"date":"2022-08-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-08-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-08-20","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-08-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-08-18","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-08-17","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-08-16","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-08-15","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-08-14","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-08-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-08-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-08-11","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-08-10","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-08-09","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-08-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-08-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-08-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-08-05","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-08-04","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-08-03","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-08-02","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-08-01","count":9,"color":"#216e39","intensity":"4"},{"date":"2022-07-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-07-30","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-07-29","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-07-28","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-07-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-07-26","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-07-25","count":15,"color":"#216e39","intensity":"4"},{"date":"2022-07-24","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-07-23","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-07-22","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-07-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-07-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-07-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-07-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-07-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-07-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-07-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-07-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-07-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-07-12","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-07-11","count":6,"color":"#30a14e","intensity":"3"},{"date":"2022-07-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-07-09","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-07-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-07-07","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-07-06","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-07-05","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-07-04","count":5,"color":"#40c463","intensity":"2"},{"date":"2022-07-03","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-07-02","count":9,"color":"#216e39","intensity":"4"},{"date":"2022-07-01","count":11,"color":"#216e39","intensity":"4"},{"date":"2022-06-30","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-06-29","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-06-28","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-06-27","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-06-26","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-06-25","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-06-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-06-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-06-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-06-21","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-06-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-06-19","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-06-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-06-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-06-16","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-06-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-06-14","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-06-13","count":6,"color":"#30a14e","intensity":"3"},{"date":"2022-06-12","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-06-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-06-10","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-06-09","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-06-08","count":8,"color":"#30a14e","intensity":"3"},{"date":"2022-06-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-06-06","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-06-05","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-06-04","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-06-03","count":6,"color":"#30a14e","intensity":"3"},{"date":"2022-06-02","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-06-01","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-05-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-05-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-05-29","count":5,"color":"#40c463","intensity":"2"},{"date":"2022-05-28","count":8,"color":"#30a14e","intensity":"3"},{"date":"2022-05-27","count":6,"color":"#30a14e","intensity":"3"},{"date":"2022-05-26","count":10,"color":"#216e39","intensity":"4"},{"date":"2022-05-25","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-05-24","count":13,"color":"#216e39","intensity":"4"},{"date":"2022-05-23","count":9,"color":"#216e39","intensity":"4"},{"date":"2022-05-22","count":6,"color":"#30a14e","intensity":"3"},{"date":"2022-05-21","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-05-20","count":6,"color":"#30a14e","intensity":"3"},{"date":"2022-05-19","count":6,"color":"#30a14e","intensity":"3"},{"date":"2022-05-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-05-17","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-05-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-05-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-05-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-05-13","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-05-12","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-05-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-05-10","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-05-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-05-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-05-07","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-05-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-05-05","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-05-04","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-05-03","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-05-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-05-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-04-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-04-29","count":7,"color":"#30a14e","intensity":"3"},{"date":"2022-04-28","count":5,"color":"#40c463","intensity":"2"},{"date":"2022-04-27","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-04-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-04-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-04-24","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-04-23","count":7,"color":"#30a14e","intensity":"3"},{"date":"2022-04-22","count":5,"color":"#40c463","intensity":"2"},{"date":"2022-04-21","count":7,"color":"#30a14e","intensity":"3"},{"date":"2022-04-20","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-04-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-04-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-04-17","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-04-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-04-15","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-04-14","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-04-13","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-04-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-04-11","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-04-10","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-04-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-04-08","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-04-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-04-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-04-05","count":5,"color":"#40c463","intensity":"2"},{"date":"2022-04-04","count":9,"color":"#216e39","intensity":"4"},{"date":"2022-04-03","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-04-02","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-04-01","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-03-31","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-03-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-28","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-03-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-26","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-03-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-24","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-03-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-22","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-03-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-19","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-03-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-17","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-03-16","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-03-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-14","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-03-13","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-03-12","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-03-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-05","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-03-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-03-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-27","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-02-26","count":6,"color":"#30a14e","intensity":"3"},{"date":"2022-02-25","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-02-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-19","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-02-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-12","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-02-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-02-06","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-02-05","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-02-04","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-02-03","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-02-02","count":7,"color":"#30a14e","intensity":"3"},{"date":"2022-02-01","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-01-31","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-01-30","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-01-29","count":5,"color":"#40c463","intensity":"2"},{"date":"2022-01-28","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-01-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-01-26","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-01-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-01-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-01-23","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-01-22","count":3,"color":"#40c463","intensity":"2"},{"date":"2022-01-21","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-01-20","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-01-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-01-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-01-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-01-16","count":5,"color":"#40c463","intensity":"2"},{"date":"2022-01-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-01-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-01-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-01-12","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-01-11","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-01-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-01-09","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-01-08","count":7,"color":"#30a14e","intensity":"3"},{"date":"2022-01-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-01-06","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2022-01-05","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2022-01-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2022-01-03","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-01-02","count":4,"color":"#40c463","intensity":"2"},{"date":"2022-01-01","count":4,"color":"#40c463","intensity":"2"},{"date":"2021-12-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-30","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-27","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-26","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-20","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-19","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-18","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-17","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-16","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-15","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-14","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-12","count":6,"color":"#40c463","intensity":"2"},{"date":"2021-12-11","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-07","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-06","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-05","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-04","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-12-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-12-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-11-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-11-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-11-28","count":6,"color":"#40c463","intensity":"2"},{"date":"2021-11-27","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-11-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-11-24","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-23","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-11-21","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-20","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-11-18","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-17","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-11-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-11-14","count":9,"color":"#40c463","intensity":"2"},{"date":"2021-11-13","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-12","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-11","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-10","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-09","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-11-07","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-11-05","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-04","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-11-02","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-11-01","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-10-31","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-10-30","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-10-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-28","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-10-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-26","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-10-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-20","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-10-19","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-10-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-17","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2021-10-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-12","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-10-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-10-07","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-10-06","count":14,"color":"#30a14e","intensity":"3"},{"date":"2021-10-05","count":13,"color":"#30a14e","intensity":"3"},{"date":"2021-10-04","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2021-10-03","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2021-10-02","count":7,"color":"#40c463","intensity":"2"},{"date":"2021-10-01","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-09-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-29","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-09-28","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-09-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-25","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-09-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-21","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-09-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-15","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-09-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-12","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-09-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-05","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-09-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-09-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-29","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-08-28","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-08-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-14","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-08-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-11","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-08-10","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-08-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-07","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-08-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-04","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-08-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-08-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-19","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-07-18","count":11,"color":"#30a14e","intensity":"3"},{"date":"2021-07-17","count":15,"color":"#30a14e","intensity":"3"},{"date":"2021-07-16","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-07-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-14","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2021-07-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-12","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-07-11","count":9,"color":"#40c463","intensity":"2"},{"date":"2021-07-10","count":20,"color":"#216e39","intensity":"4"},{"date":"2021-07-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-07","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-07-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-04","count":19,"color":"#216e39","intensity":"4"},{"date":"2021-07-03","count":10,"color":"#40c463","intensity":"2"},{"date":"2021-07-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-07-01","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-06-30","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-06-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-27","count":7,"color":"#40c463","intensity":"2"},{"date":"2021-06-26","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2021-06-25","count":7,"color":"#40c463","intensity":"2"},{"date":"2021-06-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-20","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2021-06-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-15","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-06-14","count":10,"color":"#40c463","intensity":"2"},{"date":"2021-06-13","count":7,"color":"#40c463","intensity":"2"},{"date":"2021-06-12","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-06-11","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-06-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-08","count":6,"color":"#40c463","intensity":"2"},{"date":"2021-06-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-06","count":6,"color":"#40c463","intensity":"2"},{"date":"2021-06-05","count":8,"color":"#40c463","intensity":"2"},{"date":"2021-06-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-06-03","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-06-02","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-06-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-05-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-05-30","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-29","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-28","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-05-26","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-05-24","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-23","count":26,"color":"#216e39","intensity":"4"},{"date":"2021-05-22","count":15,"color":"#30a14e","intensity":"3"},{"date":"2021-05-21","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-05-19","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-18","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-05-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-05-15","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-05-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-05-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-05-11","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-10","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-09","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-05-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-05-06","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-05","count":8,"color":"#40c463","intensity":"2"},{"date":"2021-05-04","count":6,"color":"#40c463","intensity":"2"},{"date":"2021-05-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-05-02","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-05-01","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-04-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-24","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2021-04-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-22","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-04-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-19","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2021-04-18","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2021-04-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-13","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-04-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-11","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-04-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-08","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-04-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-06","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2021-04-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-04","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-04-03","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2021-04-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-04-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-29","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-03-28","count":22,"color":"#216e39","intensity":"4"},{"date":"2021-03-27","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-03-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-25","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-03-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-21","count":6,"color":"#40c463","intensity":"2"},{"date":"2021-03-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-07","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-03-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-04","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-03-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-03-01","count":6,"color":"#40c463","intensity":"2"},{"date":"2021-02-28","count":7,"color":"#40c463","intensity":"2"},{"date":"2021-02-27","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-02-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-24","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-02-23","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-02-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-21","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2021-02-20","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2021-02-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-12","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-02-11","count":6,"color":"#40c463","intensity":"2"},{"date":"2021-02-10","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-02-09","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2021-02-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-07","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-02-06","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2021-02-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-03","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2021-02-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-02-01","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-31","count":11,"color":"#30a14e","intensity":"3"},{"date":"2021-01-30","count":10,"color":"#40c463","intensity":"2"},{"date":"2021-01-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-01-28","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-01-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-01-25","count":6,"color":"#40c463","intensity":"2"},{"date":"2021-01-24","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-23","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-01-21","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-20","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-01-18","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-17","count":12,"color":"#30a14e","intensity":"3"},{"date":"2021-01-16","count":11,"color":"#30a14e","intensity":"3"},{"date":"2021-01-15","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-14","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-01-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-01-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-01-10","count":15,"color":"#30a14e","intensity":"3"},{"date":"2021-01-09","count":7,"color":"#40c463","intensity":"2"},{"date":"2021-01-08","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-07","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-06","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-05","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-04","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2021-01-03","count":7,"color":"#40c463","intensity":"2"},{"date":"2021-01-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2021-01-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-31","count":5,"color":"#40c463","intensity":"2"},{"date":"2020-12-30","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-12-29","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-12-28","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-12-27","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-12-26","count":5,"color":"#40c463","intensity":"2"},{"date":"2020-12-25","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-12-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-18","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-12-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-12","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-12-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-07","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-12-06","count":7,"color":"#40c463","intensity":"2"},{"date":"2020-12-05","count":12,"color":"#30a14e","intensity":"3"},{"date":"2020-12-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-12-02","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-12-01","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-11-30","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-11-29","count":9,"color":"#40c463","intensity":"2"},{"date":"2020-11-28","count":12,"color":"#30a14e","intensity":"3"},{"date":"2020-11-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-26","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-11-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-23","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-11-22","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2020-11-21","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-11-20","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-11-19","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-11-18","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-11-17","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-11-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-15","count":6,"color":"#40c463","intensity":"2"},{"date":"2020-11-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-08","count":13,"color":"#30a14e","intensity":"3"},{"date":"2020-11-07","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-11-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-11-01","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-10-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-24","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-10-23","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-10-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-17","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2020-10-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-15","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-10-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-13","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-10-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-11","count":5,"color":"#40c463","intensity":"2"},{"date":"2020-10-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-09","count":6,"color":"#40c463","intensity":"2"},{"date":"2020-10-08","count":36,"color":"#216e39","intensity":"4"},{"date":"2020-10-07","count":9,"color":"#40c463","intensity":"2"},{"date":"2020-10-06","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-10-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-10-02","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-10-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-09-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-09-29","count":10,"color":"#30a14e","intensity":"3"},{"date":"2020-09-28","count":15,"color":"#216e39","intensity":"4"},{"date":"2020-09-27","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-09-26","count":5,"color":"#40c463","intensity":"2"},{"date":"2020-09-25","count":6,"color":"#40c463","intensity":"2"},{"date":"2020-09-24","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-09-23","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-09-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-09-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-09-20","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-09-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-09-18","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-09-17","count":7,"color":"#40c463","intensity":"2"},{"date":"2020-09-16","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-09-15","count":8,"color":"#40c463","intensity":"2"},{"date":"2020-09-14","count":5,"color":"#40c463","intensity":"2"},{"date":"2020-09-13","count":10,"color":"#30a14e","intensity":"3"},{"date":"2020-09-12","count":20,"color":"#216e39","intensity":"4"},{"date":"2020-09-11","count":6,"color":"#40c463","intensity":"2"},{"date":"2020-09-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-09-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-09-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-09-07","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2020-09-06","count":11,"color":"#30a14e","intensity":"3"},{"date":"2020-09-05","count":9,"color":"#40c463","intensity":"2"},{"date":"2020-09-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-09-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-09-02","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-09-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-30","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-08-29","count":6,"color":"#40c463","intensity":"2"},{"date":"2020-08-28","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-08-27","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-08-26","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-08-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-23","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2020-08-22","count":10,"color":"#30a14e","intensity":"3"},{"date":"2020-08-21","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-08-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-19","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-08-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-15","count":11,"color":"#30a14e","intensity":"3"},{"date":"2020-08-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-09","count":14,"color":"#216e39","intensity":"4"},{"date":"2020-08-08","count":6,"color":"#40c463","intensity":"2"},{"date":"2020-08-07","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-08-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-08-04","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-08-03","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-08-02","count":13,"color":"#30a14e","intensity":"3"},{"date":"2020-08-01","count":11,"color":"#30a14e","intensity":"3"},{"date":"2020-07-31","count":8,"color":"#40c463","intensity":"2"},{"date":"2020-07-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-07-29","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-07-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-07-27","count":10,"color":"#30a14e","intensity":"3"},{"date":"2020-07-26","count":16,"color":"#216e39","intensity":"4"},{"date":"2020-07-25","count":12,"color":"#30a14e","intensity":"3"},{"date":"2020-07-24","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-07-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-07-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-07-21","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-07-20","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-07-19","count":15,"color":"#216e39","intensity":"4"},{"date":"2020-07-18","count":10,"color":"#30a14e","intensity":"3"},{"date":"2020-07-17","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-07-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-07-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-07-14","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-07-13","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-07-12","count":10,"color":"#30a14e","intensity":"3"},{"date":"2020-07-11","count":10,"color":"#30a14e","intensity":"3"},{"date":"2020-07-10","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-07-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-07-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-07-07","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-07-06","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-07-05","count":5,"color":"#40c463","intensity":"2"},{"date":"2020-07-04","count":10,"color":"#30a14e","intensity":"3"},{"date":"2020-07-03","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2020-07-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-07-01","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-06-29","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-28","count":8,"color":"#40c463","intensity":"2"},{"date":"2020-06-27","count":13,"color":"#30a14e","intensity":"3"},{"date":"2020-06-26","count":17,"color":"#216e39","intensity":"4"},{"date":"2020-06-25","count":22,"color":"#216e39","intensity":"4"},{"date":"2020-06-24","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-23","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-22","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-21","count":9,"color":"#40c463","intensity":"2"},{"date":"2020-06-20","count":9,"color":"#40c463","intensity":"2"},{"date":"2020-06-19","count":11,"color":"#30a14e","intensity":"3"},{"date":"2020-06-18","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-06-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-06-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-06-14","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-13","count":5,"color":"#40c463","intensity":"2"},{"date":"2020-06-12","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-11","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-10","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-09","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-08","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-07","count":12,"color":"#30a14e","intensity":"3"},{"date":"2020-06-06","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-05","count":8,"color":"#40c463","intensity":"2"},{"date":"2020-06-04","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-03","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-06-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-06-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-31","count":5,"color":"#40c463","intensity":"2"},{"date":"2020-05-30","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-05-29","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-05-28","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-05-27","count":7,"color":"#40c463","intensity":"2"},{"date":"2020-05-26","count":5,"color":"#40c463","intensity":"2"},{"date":"2020-05-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-24","count":11,"color":"#30a14e","intensity":"3"},{"date":"2020-05-23","count":9,"color":"#40c463","intensity":"2"},{"date":"2020-05-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-10","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-05-09","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-05-08","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-05-07","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-05-06","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-05-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-04","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-05-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-05-01","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-04-30","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-04-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-25","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-04-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-23","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-04-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-20","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-04-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-18","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-04-17","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-04-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-14","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-04-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-12","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-04-11","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-04-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-05","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-04-04","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2020-04-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-04-02","count":8,"color":"#40c463","intensity":"2"},{"date":"2020-04-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-29","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2020-03-28","count":18,"color":"#216e39","intensity":"4"},{"date":"2020-03-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-22","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-03-21","count":11,"color":"#30a14e","intensity":"3"},{"date":"2020-03-20","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2020-03-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-03","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-03-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-03-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-16","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2020-02-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-12","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2020-02-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-02-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-22","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2020-01-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2020-01-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-20","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-12-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-07","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-12-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-12-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-26","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-11-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-24","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2019-11-23","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2019-11-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-17","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-11-16","count":12,"color":"#30a14e","intensity":"3"},{"date":"2019-11-15","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-11-14","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-11-13","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2019-11-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-11-03","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-11-02","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-11-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-22","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-10-21","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-10-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-19","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-10-18","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-10-17","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-10-16","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-10-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-13","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-10-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-08","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-10-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-06","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-10-05","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-10-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-10-02","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2019-10-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-29","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-09-28","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-09-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-20","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-09-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-17","count":5,"color":"#40c463","intensity":"2"},{"date":"2019-09-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-15","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2019-09-14","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2019-09-13","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-09-12","count":9,"color":"#30a14e","intensity":"3"},{"date":"2019-09-11","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2019-09-10","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-09-09","count":9,"color":"#30a14e","intensity":"3"},{"date":"2019-09-08","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-09-07","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-09-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-09-03","count":7,"color":"#40c463","intensity":"2"},{"date":"2019-09-02","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2019-09-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-08-31","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2019-08-30","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2019-08-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-08-28","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-08-27","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-08-26","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-08-25","count":9,"color":"#30a14e","intensity":"3"},{"date":"2019-08-24","count":13,"color":"#216e39","intensity":"4"},{"date":"2019-08-23","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2019-08-22","count":16,"color":"#216e39","intensity":"4"},{"date":"2019-08-21","count":10,"color":"#30a14e","intensity":"3"},{"date":"2019-08-20","count":20,"color":"#216e39","intensity":"4"},{"date":"2019-08-19","count":18,"color":"#216e39","intensity":"4"},{"date":"2019-08-18","count":11,"color":"#30a14e","intensity":"3"},{"date":"2019-08-17","count":18,"color":"#216e39","intensity":"4"},{"date":"2019-08-16","count":13,"color":"#216e39","intensity":"4"},{"date":"2019-08-15","count":13,"color":"#216e39","intensity":"4"},{"date":"2019-08-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-08-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-08-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-08-11","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-08-10","count":9,"color":"#30a14e","intensity":"3"},{"date":"2019-08-09","count":5,"color":"#40c463","intensity":"2"},{"date":"2019-08-08","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-08-07","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-08-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-08-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-08-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-08-03","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-08-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-08-01","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-31","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-30","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-26","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-25","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-24","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-14","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-13","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-09","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-08","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-07","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-06","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-04","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-03","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-07-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-07-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-27","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-06-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-22","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-06-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-19","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-06-18","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-06-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-14","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-06-13","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2019-06-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-11","count":11,"color":"#30a14e","intensity":"3"},{"date":"2019-06-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-06","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-06-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-03","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-06-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-06-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-31","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-05-30","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2019-05-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-28","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-05-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-18","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-05-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-14","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-05-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-10","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-05-09","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-05-08","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-05-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-04","count":11,"color":"#30a14e","intensity":"3"},{"date":"2019-05-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-05-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-30","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-04-29","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2019-04-28","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-04-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-24","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-04-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-20","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-04-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-13","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2019-04-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-08","count":6,"color":"#40c463","intensity":"2"},{"date":"2019-04-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-04-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-31","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-03-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-05","count":7,"color":"#40c463","intensity":"2"},{"date":"2019-03-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-03-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-23","count":8,"color":"#40c463","intensity":"2"},{"date":"2019-02-22","count":7,"color":"#40c463","intensity":"2"},{"date":"2019-02-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-02-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-18","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2019-01-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-06","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2019-01-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2019-01-02","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2019-01-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-23","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-12-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-11","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-12-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-12-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-30","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-11-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-26","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-11-25","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-11-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-23","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-11-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-19","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2018-11-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-15","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-11-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-13","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-11-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-03","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-11-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-11-01","count":10,"color":"#40c463","intensity":"2"},{"date":"2018-10-31","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-10-30","count":14,"color":"#40c463","intensity":"2"},{"date":"2018-10-29","count":11,"color":"#40c463","intensity":"2"},{"date":"2018-10-28","count":6,"color":"#9be9a8","intensity":"1"},{"date":"2018-10-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-10-26","count":34,"color":"#216e39","intensity":"4"},{"date":"2018-10-25","count":10,"color":"#40c463","intensity":"2"},{"date":"2018-10-24","count":34,"color":"#216e39","intensity":"4"},{"date":"2018-10-23","count":8,"color":"#9be9a8","intensity":"1"},{"date":"2018-10-22","count":16,"color":"#40c463","intensity":"2"},{"date":"2018-10-21","count":18,"color":"#30a14e","intensity":"3"},{"date":"2018-10-20","count":24,"color":"#30a14e","intensity":"3"},{"date":"2018-10-19","count":34,"color":"#216e39","intensity":"4"},{"date":"2018-10-18","count":34,"color":"#216e39","intensity":"4"},{"date":"2018-10-17","count":8,"color":"#9be9a8","intensity":"1"},{"date":"2018-10-16","count":8,"color":"#9be9a8","intensity":"1"},{"date":"2018-10-15","count":14,"color":"#40c463","intensity":"2"},{"date":"2018-10-14","count":30,"color":"#216e39","intensity":"4"},{"date":"2018-10-13","count":8,"color":"#9be9a8","intensity":"1"},{"date":"2018-10-12","count":20,"color":"#30a14e","intensity":"3"},{"date":"2018-10-11","count":15,"color":"#40c463","intensity":"2"},{"date":"2018-10-10","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-10-09","count":37,"color":"#216e39","intensity":"4"},{"date":"2018-10-08","count":70,"color":"#216e39","intensity":"4"},{"date":"2018-10-07","count":6,"color":"#9be9a8","intensity":"1"},{"date":"2018-10-06","count":20,"color":"#30a14e","intensity":"3"},{"date":"2018-10-05","count":16,"color":"#40c463","intensity":"2"},{"date":"2018-10-04","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2018-10-03","count":36,"color":"#216e39","intensity":"4"},{"date":"2018-10-02","count":9,"color":"#40c463","intensity":"2"},{"date":"2018-10-01","count":12,"color":"#40c463","intensity":"2"},{"date":"2018-09-30","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-09-29","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-09-28","count":10,"color":"#40c463","intensity":"2"},{"date":"2018-09-27","count":16,"color":"#40c463","intensity":"2"},{"date":"2018-09-26","count":24,"color":"#30a14e","intensity":"3"},{"date":"2018-09-25","count":8,"color":"#9be9a8","intensity":"1"},{"date":"2018-09-24","count":12,"color":"#40c463","intensity":"2"},{"date":"2018-09-23","count":14,"color":"#40c463","intensity":"2"},{"date":"2018-09-22","count":18,"color":"#30a14e","intensity":"3"},{"date":"2018-09-21","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2018-09-20","count":20,"color":"#30a14e","intensity":"3"},{"date":"2018-09-19","count":16,"color":"#40c463","intensity":"2"},{"date":"2018-09-18","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-09-17","count":22,"color":"#30a14e","intensity":"3"},{"date":"2018-09-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-09-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-09-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-09-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-09-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-09-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-09-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-09-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-09-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-09-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-09-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-09-05","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-09-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-09-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-09-02","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2018-09-01","count":9,"color":"#40c463","intensity":"2"},{"date":"2018-08-31","count":7,"color":"#9be9a8","intensity":"1"},{"date":"2018-08-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-25","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2018-08-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-23","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2018-08-22","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-08-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-20","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2018-08-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-18","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-08-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-12","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-08-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-10","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-08-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-08-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-24","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-07-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-07-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-11","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2018-06-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-06-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-22","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-05-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-18","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-05-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-05-01","count":7,"color":"#9be9a8","intensity":"1"},{"date":"2018-04-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-26","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-04-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-22","count":8,"color":"#9be9a8","intensity":"1"},{"date":"2018-04-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-19","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-04-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-14","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-04-13","count":9,"color":"#40c463","intensity":"2"},{"date":"2018-04-12","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-04-11","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-04-10","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2018-04-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-06","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-04-05","count":8,"color":"#9be9a8","intensity":"1"},{"date":"2018-04-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-04-02","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2018-04-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-31","count":14,"color":"#40c463","intensity":"2"},{"date":"2018-03-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-28","count":7,"color":"#9be9a8","intensity":"1"},{"date":"2018-03-27","count":6,"color":"#9be9a8","intensity":"1"},{"date":"2018-03-26","count":8,"color":"#9be9a8","intensity":"1"},{"date":"2018-03-25","count":11,"color":"#40c463","intensity":"2"},{"date":"2018-03-24","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2018-03-23","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2018-03-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-21","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-03-20","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2018-03-19","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-03-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-17","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2018-03-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-13","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-03-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-11","count":12,"color":"#40c463","intensity":"2"},{"date":"2018-03-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-07","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-03-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-05","count":7,"color":"#9be9a8","intensity":"1"},{"date":"2018-03-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-03-03","count":9,"color":"#40c463","intensity":"2"},{"date":"2018-03-02","count":9,"color":"#40c463","intensity":"2"},{"date":"2018-03-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-28","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-02-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-25","count":4,"color":"#9be9a8","intensity":"1"},{"date":"2018-02-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-23","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-02-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-21","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-02-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-02-02","count":19,"color":"#30a14e","intensity":"3"},{"date":"2018-02-01","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-01-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-30","count":22,"color":"#30a14e","intensity":"3"},{"date":"2018-01-29","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-01-28","count":18,"color":"#30a14e","intensity":"3"},{"date":"2018-01-27","count":7,"color":"#9be9a8","intensity":"1"},{"date":"2018-01-26","count":10,"color":"#40c463","intensity":"2"},{"date":"2018-01-25","count":7,"color":"#9be9a8","intensity":"1"},{"date":"2018-01-24","count":11,"color":"#40c463","intensity":"2"},{"date":"2018-01-23","count":7,"color":"#9be9a8","intensity":"1"},{"date":"2018-01-22","count":7,"color":"#9be9a8","intensity":"1"},{"date":"2018-01-21","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-01-20","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2018-01-19","count":2,"color":"#9be9a8","intensity":"1"},{"date":"2018-01-18","count":5,"color":"#9be9a8","intensity":"1"},{"date":"2018-01-17","count":22,"color":"#30a14e","intensity":"3"},{"date":"2018-01-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-14","count":3,"color":"#9be9a8","intensity":"1"},{"date":"2018-01-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2018-01-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-24","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-12-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-22","count":2,"color":"#40c463","intensity":"2"},{"date":"2017-12-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-04","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-12-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-12-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-19","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-11-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-16","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-11-15","count":2,"color":"#40c463","intensity":"2"},{"date":"2017-11-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-11-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-13","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-10-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-07","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-10-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-10-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-23","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-09-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-13","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-09-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-09","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-09-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-09-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-27","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-08-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-22","count":3,"color":"#30a14e","intensity":"3"},{"date":"2017-08-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-14","count":2,"color":"#40c463","intensity":"2"},{"date":"2017-08-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-08-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-25","count":3,"color":"#30a14e","intensity":"3"},{"date":"2017-07-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-21","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-07-20","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-07-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-15","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-07-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-06","count":4,"color":"#216e39","intensity":"4"},{"date":"2017-07-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-03","count":2,"color":"#40c463","intensity":"2"},{"date":"2017-07-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-07-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-22","count":2,"color":"#40c463","intensity":"2"},{"date":"2017-06-21","count":1,"color":"#9be9a8","intensity":"1"},{"date":"2017-06-20","count":5,"color":"#216e39","intensity":"4"},{"date":"2017-06-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-15","count":3,"color":"#30a14e","intensity":"3"},{"date":"2017-06-14","count":4,"color":"#216e39","intensity":"4"},{"date":"2017-06-13","count":3,"color":"#30a14e","intensity":"3"},{"date":"2017-06-12","count":4,"color":"#216e39","intensity":"4"},{"date":"2017-06-11","count":4,"color":"#216e39","intensity":"4"},{"date":"2017-06-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-06","count":2,"color":"#40c463","intensity":"2"},{"date":"2017-06-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-06-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-27","count":2,"color":"#40c463","intensity":"2"},{"date":"2017-05-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-25","count":2,"color":"#40c463","intensity":"2"},{"date":"2017-05-24","count":7,"color":"#216e39","intensity":"4"},{"date":"2017-05-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-05-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-04-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-03-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-02-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2017-01-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-12-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-11-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-10-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-09-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-08-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-17","count":1,"color":"#216e39","intensity":"4"},{"date":"2016-07-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-07-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-06-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-05-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-04-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-03-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-02-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2016-01-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-12-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-11-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-10-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-09-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-08-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-07-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-06-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-05-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-20","count":1,"color":"#216e39","intensity":"4"},{"date":"2015-04-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-04-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-03-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-02-01","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-31","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-30","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-29","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-28","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-27","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-26","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-25","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-24","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-23","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-22","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-21","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-20","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-19","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-18","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-17","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-16","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-15","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-14","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-13","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-12","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-11","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-10","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-09","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-08","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-07","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-06","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-05","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-04","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-03","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-02","count":0,"color":"#ebedf0","intensity":"0"},{"date":"2015-01-01","count":0,"color":"#ebedf0","intensity":"0"}]} \ No newline at end of file diff --git a/data/gapminder-2020.rds b/data/gapminder-2020.rds deleted file mode 100755 index b67203fb..00000000 Binary files a/data/gapminder-2020.rds and /dev/null differ diff --git a/data/rongelap.rds b/data/rongelap.rds deleted file mode 100755 index 4a041648..00000000 Binary files a/data/rongelap.rds and /dev/null differ diff --git a/data/rongelap_coastline.rds b/data/rongelap_coastline.rds deleted file mode 100755 index 40609475..00000000 Binary files a/data/rongelap_coastline.rds and /dev/null differ diff --git a/data/rversion-2022.rds b/data/rversion-2022.rds deleted file mode 100755 index 8e66e3c0..00000000 Binary files a/data/rversion-2022.rds and /dev/null differ diff --git a/data/usa-mortality-2020.rds b/data/usa-mortality-2020.rds deleted file mode 100755 index e3a47d6d..00000000 Binary files a/data/usa-mortality-2020.rds and /dev/null differ diff --git a/data/volcano.csv b/data/volcano.csv deleted file mode 100644 index 5191142e..00000000 --- a/data/volcano.csv +++ /dev/null @@ -1,87 +0,0 @@ -100,100,101,101,101,101,101,100,100,100,101,101,102,102,102,102,103,104,103,102,101,101,102,103,104,104,105,107,107,107,108,108,110,110,110,110,110,110,110,110,108,108,108,107,107,108,108,108,108,108,107,107,107,107,106,106,105,105,104,104,103 -101,101,102,102,102,102,102,101,101,101,102,102,103,103,103,103,104,105,104,103,102,102,103,105,106,106,107,109,110,110,110,110,111,112,113,114,116,115,114,112,110,110,110,109,108,109,109,109,109,108,108,108,108,107,107,106,106,105,105,104,104 -102,102,103,103,103,103,103,102,102,102,103,103,104,104,104,104,105,106,105,104,104,105,106,107,108,110,111,113,114,115,114,115,116,118,119,119,121,121,120,118,116,114,112,111,110,110,110,110,109,109,109,109,108,108,107,107,106,106,105,105,104 -103,103,104,104,104,104,104,103,103,103,103,104,104,104,105,105,106,107,106,106,106,107,108,110,111,114,117,118,117,119,120,121,122,124,125,126,127,127,126,124,122,120,117,116,113,111,110,110,110,109,109,109,109,108,108,107,107,106,106,105,105 -104,104,105,105,105,105,105,104,104,103,104,104,105,105,105,106,107,108,108,108,109,110,112,114,115,118,121,122,121,123,128,131,129,130,131,131,132,132,131,130,128,126,122,119,115,114,112,110,110,110,110,110,109,109,108,107,107,107,106,106,105 -105,105,105,106,106,106,106,105,105,104,104,105,105,106,106,107,109,110,110,112,113,115,116,118,119,121,124,126,126,129,134,137,137,136,136,135,136,136,136,135,133,129,126,122,118,116,115,113,111,110,110,110,110,109,108,108,108,107,107,106,106 -105,106,106,107,107,107,107,106,106,105,105,106,106,107,108,109,111,113,114,116,118,120,121,122,123,125,127,129,130,135,140,142,142,142,141,140,140,140,140,139,137,134,129,125,121,118,116,114,112,110,110,110,111,110,109,109,108,108,107,107,106 -106,107,107,108,108,108,108,107,107,106,106,107,108,108,110,113,115,117,118,120,122,124,125,127,128,129,131,134,135,141,146,147,146,146,145,144,144,144,143,142,141,139,135,130,126,122,118,116,114,112,112,113,112,110,110,109,109,108,108,107,106 -107,108,108,109,109,109,109,108,108,107,108,108,110,111,113,116,118,120,123,125,127,129,130,132,134,135,137,139,142,146,152,152,151,151,150,149,148,148,146,145,143,142,139,135,131,127,122,119,117,115,115,115,114,112,110,110,109,109,108,107,107 -108,109,109,110,110,110,110,109,109,108,110,110,113,116,118,120,122,125,127,129,133,136,138,140,141,142,148,150,151,156,158,159,158,157,158,158,154,151,149,148,146,144,141,137,134,130,125,122,120,118,117,117,115,113,111,110,110,109,108,107,107 -109,110,110,111,111,111,111,110,110,110,112,114,118,121,123,125,127,129,133,137,141,143,145,146,148,150,154,156,159,161,162,163,164,163,164,164,160,157,154,151,149,146,144,140,137,133,129,126,124,121,119,118,116,114,112,111,110,109,108,107,106 -110,110,111,113,112,111,113,112,112,114,116,119,121,124,127,129,133,138,143,146,149,149,151,153,154,157,159,160,163,165,166,167,168,168,168,168,166,162,159,157,154,152,149,144,140,136,133,131,128,125,122,119,117,115,113,111,110,109,108,107,106 -110,111,113,115,114,113,114,114,115,117,119,121,124,126,129,133,140,145,150,154,155,155,157,159,161,162,164,165,167,168,169,170,172,174,172,172,171,169,166,163,161,158,153,148,143,140,137,134,131,128,125,120,118,116,114,112,110,109,108,107,105 -111,113,115,117,116,115,116,117,117,119,121,124,126,128,132,137,143,151,156,161,161,162,163,165,166,167,168,170,171,173,175,177,179,178,177,176,176,174,171,169,165,161,156,152,148,144,140,138,135,131,127,123,119,117,115,113,111,110,108,106,105 -114,115,117,117,117,118,119,119,120,121,124,126,128,131,137,143,150,156,160,163,165,168,170,171,172,173,174,175,177,179,180,182,183,183,183,183,180,178,177,172,168,164,160,156,152,148,144,141,138,134,130,126,121,117,114,112,110,110,108,106,104 -116,118,118,118,120,121,121,122,122,123,125,128,130,134,141,147,152,156,160,165,168,170,174,176,179,180,181,181,182,182,183,184,186,187,187,184,184,181,180,176,172,168,165,161,157,153,149,145,142,138,133,129,125,120,115,111,110,110,108,106,104 -118,120,120,121,122,123,124,124,125,126,127,129,132,135,142,149,153,157,161,166,170,174,178,180,182,183,184,184,185,186,186,187,189,189,189,189,189,186,182,179,175,171,168,165,162,157,152,149,145,141,137,131,125,120,116,111,110,110,108,106,104 -120,121,122,123,124,125,126,127,127,128,130,132,134,137,142,151,155,158,162,169,172,176,181,183,184,186,187,188,189,189,189,189,190,190,191,190,190,188,186,183,180,175,171,168,165,161,157,152,149,145,141,134,127,121,116,112,110,110,108,106,104 -120,122,125,126,126,127,128,129,130,130,132,134,136,139,145,152,157,160,167,172,175,178,181,185,186,188,190,191,192,193,193,192,192,191,192,191,191,190,190,187,184,181,177,172,169,165,161,156,152,147,143,139,131,123,119,115,111,110,108,106,105 -121,124,126,128,129,129,130,131,132,133,135,137,139,143,150,154,159,164,170,173,176,179,184,186,189,190,191,192,193,194,195,194,193,192,191,191,191,191,190,190,188,184,181,177,173,169,165,160,155,149,145,142,136,129,123,118,114,110,108,108,107 -122,125,127,130,130,131,133,134,135,136,137,140,143,147,154,158,162,166,171,174,177,181,186,189,190,190,191,192,191,191,190,189,188,189,190,190,191,190,190,190,189,186,184,181,177,173,169,164,158,152,148,144,140,134,125,118,115,111,110,108,107 -122,125,128,130,132,133,135,136,137,139,140,143,147,152,157,161,164,168,172,175,179,182,186,190,190,190,190,189,187,184,184,183,182,182,183,183,183,184,185,186,187,186,185,184,181,177,173,169,163,157,149,145,141,136,130,119,116,112,110,108,106 -123,126,129,131,133,135,137,138,139,141,143,147,150,156,161,164,167,170,173,177,181,184,187,188,190,189,187,185,183,179,176,174,174,174,174,174,176,177,179,180,182,183,182,181,181,180,176,171,166,160,152,147,142,138,133,126,121,115,110,106,105 -124,127,130,132,135,137,138,140,142,144,147,149,154,157,161,165,168,171,175,178,181,184,186,187,187,184,184,181,179,175,171,169,168,168,168,169,170,172,174,177,178,179,180,181,181,180,179,174,167,161,155,148,144,139,134,128,121,115,110,106,105 -123,128,131,133,136,138,140,142,144,146,149,151,154,157,160,164,168,172,175,178,181,183,184,184,185,183,180,177,174,170,167,165,164,164,164,165,166,168,171,175,176,178,180,181,180,180,179,177,170,163,157,150,144,139,134,128,121,115,110,108,107 -123,127,131,134,136,138,140,142,144,147,149,151,154,157,160,164,168,171,174,178,180,181,181,182,183,181,178,173,169,166,163,161,161,160,160,161,163,165,168,173,176,178,179,180,181,180,180,175,173,166,159,152,145,139,134,127,121,115,110,109,108 -120,124,128,131,134,137,139,142,144,146,149,151,153,156,160,163,167,171,174,178,180,180,180,180,180,180,175,171,167,162,160,158,157,157,157,158,159,162,166,170,175,177,178,180,181,181,180,178,175,169,160,154,148,140,134,128,121,115,110,110,109 -118,121,125,129,132,134,137,140,142,145,147,149,151,155,159,163,166,169,173,177,179,180,180,180,180,179,174,169,166,161,158,156,154,153,153,154,156,159,163,169,173,175,178,180,181,180,180,179,175,170,160,154,149,142,135,128,122,116,111,110,110 -117,120,121,125,129,132,135,138,140,143,145,147,149,153,157,160,163,166,171,174,177,179,180,180,180,179,172,168,164,160,157,154,151,149,150,150,154,158,164,169,174,178,180,180,180,180,178,177,175,170,161,153,148,142,135,129,123,116,113,112,110 -115,118,120,122,126,130,133,136,138,141,143,145,148,151,154,157,160,163,168,171,174,177,179,179,179,176,171,167,164,160,156,153,149,148,149,151,155,158,163,170,173,177,179,180,180,180,178,175,173,171,162,154,147,141,136,130,124,117,115,112,110 -114,116,118,120,122,127,131,133,136,138,141,143,146,148,151,154,157,160,164,168,171,174,178,178,179,177,173,169,165,161,157,154,151,149,150,152,155,159,166,171,175,177,179,180,180,179,176,174,171,168,159,151,146,141,135,129,124,119,116,113,110 -115,114,116,118,120,122,127,129,132,136,139,141,143,146,148,151,153,156,160,164,167,172,174,176,177,176,173,170,166,162,159,157,154,153,154,155,158,161,169,172,174,176,178,178,178,178,175,172,169,162,156,149,144,140,134,128,123,118,115,112,110 -113,113,114,116,118,120,122,125,129,133,136,138,141,143,146,149,150,153,156,160,165,170,173,176,176,176,173,172,169,165,163,160,158,157,158,159,161,166,170,170,173,175,176,178,176,173,171,168,164,158,153,146,140,137,132,127,121,117,113,111,110 -111,112,113,114,116,118,120,122,126,130,133,136,139,142,145,147,148,151,155,158,163,168,173,176,177,177,176,174,171,169,166,164,161,161,162,164,165,167,170,170,171,173,173,173,170,168,165,163,160,155,149,143,138,134,130,125,119,116,112,110,109 -110,112,113,113,114,116,118,120,123,127,131,134,137,141,143,145,148,150,154,157,161,166,171,176,178,178,178,176,174,172,170,167,167,167,166,168,170,169,168,167,168,168,168,168,167,165,163,160,156,152,146,140,136,131,128,122,118,114,110,110,109 -109,110,111,112,114,116,118,119,120,124,128,131,136,140,142,145,147,150,153,157,160,165,170,174,178,179,179,178,178,176,174,171,170,170,170,168,167,166,164,163,161,162,163,163,163,161,160,157,153,148,142,136,130,127,124,120,117,113,110,110,109 -108,109,111,112,114,116,117,118,120,121,125,128,132,138,142,144,147,149,153,156,160,164,170,174,178,180,180,179,179,178,176,172,170,170,170,168,166,164,162,160,157,156,157,158,158,156,153,151,149,144,139,130,127,124,121,118,115,112,110,110,109 -108,109,111,113,114,116,117,118,119,120,122,126,130,135,139,143,147,149,152,156,160,164,169,173,177,180,180,180,180,179,178,174,170,170,168,167,165,163,161,157,154,153,152,152,152,149,148,147,144,140,134,128,125,122,119,117,114,110,110,109,109 -107,108,111,112,114,115,116,117,119,120,121,124,128,133,137,141,145,149,152,156,160,164,168,172,176,179,180,180,180,179,178,174,170,168,166,165,163,161,158,154,150,149,148,146,145,143,143,143,140,136,130,126,123,120,118,115,112,110,110,109,109 -107,108,110,112,113,113,115,116,118,120,122,125,128,132,136,140,145,148,150,155,160,164,167,170,174,177,179,179,178,176,176,173,169,166,164,163,161,159,155,152,148,145,143,141,140,139,139,138,136,132,128,124,121,118,116,114,111,110,110,109,108 -107,108,109,111,113,114,116,117,119,120,122,125,128,132,137,141,144,146,149,152,157,162,166,168,171,173,175,175,173,172,172,171,168,165,162,160,158,156,153,149,145,142,139,138,137,136,135,133,131,129,126,122,119,117,114,112,110,110,109,108,107 -108,109,110,112,114,115,116,117,119,120,122,126,129,133,137,141,143,146,148,151,155,160,164,167,168,169,170,170,169,168,167,168,166,163,160,158,155,153,150,147,143,140,137,136,134,133,132,130,129,127,125,121,118,115,112,110,110,110,108,107,107 -109,110,111,113,115,116,117,118,120,121,123,126,129,133,138,141,143,146,148,150,155,159,163,165,166,167,168,168,166,165,164,161,160,159,158,155,152,149,147,144,141,138,135,134,132,130,129,128,126,124,122,120,117,113,111,110,110,110,108,107,107 -110,111,112,113,116,117,118,119,120,122,125,127,130,133,138,141,143,146,148,150,154,159,162,163,164,166,166,166,165,163,161,159,157,156,155,153,150,146,143,140,138,136,133,132,130,129,128,125,124,122,120,119,117,114,111,110,110,109,108,107,107 -111,112,113,114,116,117,118,119,120,123,125,128,130,134,139,141,144,146,148,151,154,158,161,164,166,167,168,166,165,163,161,158,156,154,152,150,146,142,139,137,135,133,131,130,129,128,127,125,123,121,120,118,116,113,111,110,110,109,108,107,106 -111,112,113,115,117,118,118,120,121,124,126,128,131,135,139,142,144,146,148,151,155,160,164,165,168,169,169,168,166,163,160,158,156,153,151,148,145,142,139,137,135,132,130,129,127,126,125,124,123,120,120,117,116,114,112,110,110,108,107,106,106 -112,113,114,116,117,118,119,120,122,124,127,129,132,135,139,142,144,146,149,152,157,162,167,169,170,170,170,168,165,163,161,159,157,155,151,148,145,141,139,136,134,132,130,128,127,126,124,123,122,120,119,117,116,114,112,111,109,107,106,106,105 -113,114,115,116,117,119,119,120,122,125,127,129,132,135,139,142,144,147,149,154,159,164,169,170,170,170,170,170,168,165,163,161,158,155,151,148,145,142,139,137,135,132,131,128,126,125,124,122,121,120,119,117,115,113,111,110,109,106,105,105,104 -113,114,115,117,118,119,120,121,123,125,127,130,132,135,139,142,145,148,150,156,161,166,170,170,170,170,170,170,169,166,163,161,159,155,151,148,146,143,140,138,135,134,132,130,127,125,123,121,120,120,119,116,114,112,110,110,108,106,105,104,104 -114,115,116,117,118,119,120,121,123,126,128,130,133,136,139,142,145,148,152,157,161,166,168,170,170,170,170,168,166,164,163,160,159,155,151,148,146,143,141,138,136,134,132,130,128,125,123,121,120,120,118,116,113,111,110,110,109,106,105,104,104 -115,116,117,118,119,120,121,121,123,126,128,131,134,136,139,142,145,149,152,157,161,163,164,166,168,167,166,164,163,161,160,158,156,152,149,147,144,143,141,139,136,134,132,130,128,125,122,120,120,119,117,115,113,110,110,109,107,106,105,104,104 -115,116,117,118,119,120,121,122,123,125,128,131,134,137,139,142,145,149,152,156,159,159,160,162,162,161,161,160,159,158,157,155,153,150,148,146,145,143,142,140,137,134,131,129,126,124,122,120,119,117,115,113,111,110,109,109,107,106,105,104,104 -114,115,116,116,118,119,120,121,122,126,129,132,135,137,140,143,146,149,152,155,156,157,158,159,159,159,158,158,157,155,153,151,150,149,147,146,145,144,142,141,138,135,132,128,125,122,120,118,117,115,113,112,110,109,108,108,106,105,105,104,104 -113,114,115,116,117,118,119,120,123,126,129,132,135,138,140,143,146,148,151,153,154,156,157,157,157,157,156,155,154,152,150,149,148,147,146,145,144,142,141,140,139,136,132,129,125,121,118,116,115,113,111,110,109,108,108,107,106,105,104,104,104 -112,113,114,115,116,117,119,120,122,126,130,133,136,138,141,143,146,148,150,152,154,155,155,155,155,155,154,152,152,150,148,147,146,145,145,143,142,141,140,140,140,137,133,129,125,120,117,115,111,110,110,109,108,107,107,106,105,105,104,104,103 -111,112,114,115,116,117,118,120,122,125,131,134,137,139,142,144,146,148,150,152,153,153,153,153,153,153,153,151,149,147,146,144,144,143,143,142,141,140,140,140,140,138,134,130,123,120,118,111,110,110,110,108,107,106,108,105,105,104,104,103,103 -111,112,113,115,115,116,117,119,121,126,131,135,138,140,142,144,146,148,150,151,151,151,151,151,151,151,151,150,148,146,144,142,141,141,142,141,140,140,140,140,140,140,136,132,126,120,115,110,110,110,109,107,106,105,107,105,104,104,104,103,103 -112,113,113,114,115,116,117,119,122,127,132,135,139,141,143,145,147,149,150,150,150,150,150,150,150,150,150,149,147,144,142,141,140,140,140,140,140,140,140,140,140,140,137,133,128,120,117,110,110,110,108,106,105,105,106,105,104,104,103,103,103 -112,113,114,114,116,117,118,120,122,128,132,136,139,141,144,146,147,149,150,150,150,150,150,150,150,150,150,149,146,143,141,140,140,139,139,139,140,140,140,140,140,140,137,133,129,121,118,110,110,109,107,106,105,105,105,104,104,103,103,103,102 -112,114,114,115,116,117,119,120,122,128,133,136,140,142,144,146,148,150,150,150,150,150,150,150,150,150,150,148,145,142,140,138,138,138,137,138,140,140,140,140,140,140,137,134,130,122,118,110,110,108,106,105,103,104,104,104,104,103,103,102,102 -113,114,115,116,116,117,118,120,123,129,133,137,140,142,144,146,149,150,150,150,150,150,150,150,150,150,150,147,143,141,139,137,136,136,135,136,138,140,140,140,140,139,136,134,130,123,119,113,109,108,106,104,103,104,104,104,103,103,102,102,101 -114,115,115,116,117,118,118,120,123,129,133,137,140,143,145,147,150,150,150,150,150,150,150,150,150,150,148,145,142,139,138,136,135,134,134,134,136,138,137,138,139,137,134,132,125,122,117,114,109,107,105,103,102,104,104,103,103,102,102,101,101 -114,115,116,117,117,119,118,120,123,128,132,136,139,142,145,148,150,150,150,150,150,150,150,150,150,150,147,144,141,139,136,135,134,133,132,132,134,134,134,134,135,133,131,128,124,120,116,113,110,107,104,102,102,103,103,103,102,102,102,101,100 -115,116,116,117,118,119,119,120,124,128,132,136,139,142,145,148,150,150,150,150,150,150,150,150,150,149,146,143,140,138,135,134,133,131,131,131,131,131,131,131,130,127,124,122,119,117,115,112,109,106,104,101,102,103,103,102,102,102,101,100,100 -115,116,117,118,118,119,120,123,125,128,131,135,138,141,145,148,150,150,150,150,150,150,150,150,150,147,145,142,139,137,134,132,131,130,129,128,128,128,128,128,126,123,121,119,116,114,112,110,108,105,103,101,103,103,103,102,102,101,100,100,100 -116,117,118,118,119,120,122,123,125,128,131,134,137,141,145,148,149,150,150,150,150,150,150,150,148,145,143,141,138,135,133,130,129,128,127,126,125,125,125,124,123,120,118,116,114,111,109,107,106,104,102,100,101,101,102,102,101,100,100,100,100 -116,117,118,119,120,121,123,124,126,128,130,133,137,140,144,145,147,148,149,150,149,149,147,146,144,141,139,136,133,131,129,128,127,126,125,124,123,123,122,121,120,118,116,114,112,108,107,105,103,102,100,100,100,100,101,101,100,100,100,100,100 -117,118,119,119,120,121,123,124,126,128,129,131,135,139,142,143,145,146,147,147,147,146,144,142,140,138,135,133,130,128,127,126,125,124,123,122,121,120,119,118,117,115,114,112,110,106,105,102,101,100,100,100,100,100,100,100,100,99,99,99,99 -117,118,119,120,120,121,123,124,125,126,128,129,132,137,140,142,143,143,144,144,144,143,141,139,137,135,133,130,128,127,126,125,123,122,121,120,119,117,116,115,114,112,111,108,107,105,100,100,100,100,100,100,100,99,99,99,99,99,99,99,98 -116,117,118,120,120,121,122,123,124,125,126,128,130,134,139,140,141,141,141,141,141,140,138,136,134,133,131,129,127,125,124,123,122,120,119,118,117,116,114,112,111,108,109,106,106,100,100,100,100,100,99,99,99,99,99,99,99,98,98,98,97 -114,115,116,117,119,119,120,121,122,123,125,127,129,133,136,134,134,136,138,138,137,137,135,133,132,130,129,127,125,124,122,121,120,119,117,116,115,114,112,110,109,108,107,105,105,100,100,100,100,99,99,99,98,98,98,98,98,97,97,97,97 -112,113,114,115,116,116,117,119,120,122,124,126,127,129,129,128,127,129,132,133,133,133,133,131,129,127,126,125,124,122,121,119,118,117,116,114,113,112,110,109,108,106,106,105,100,100,100,98,98,98,98,98,98,97,97,97,97,97,97,97,96 -109,111,112,112,113,113,113,114,116,119,121,123,124,125,124,123,123,123,125,127,129,129,128,128,127,125,124,123,122,121,119,118,117,116,114,113,112,110,109,108,107,106,105,100,100,100,97,97,97,97,97,97,97,96,96,96,96,96,96,96,96 -106,107,108,108,109,110,110,112,113,114,117,119,120,121,119,117,117,117,118,120,123,124,125,125,125,123,121,120,120,119,118,117,116,115,114,113,111,109,109,107,106,105,100,100,100,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96 -104,105,105,106,106,107,108,108,109,109,111,115,116,114,113,112,111,110,111,113,116,119,122,122,122,121,120,119,118,118,117,116,115,114,113,112,111,108,108,106,105,100,100,100,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96 -102,103,103,104,104,105,106,106,107,108,109,111,112,110,109,108,108,108,108,109,110,112,116,117,117,118,118,118,117,116,116,115,114,113,112,111,110,107,107,105,100,100,100,97,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96 -101,102,103,103,104,105,105,106,106,107,108,109,109,107,106,106,105,105,105,106,107,108,109,110,111,113,114,115,115,115,114,113,112,111,110,108,108,106,105,100,100,100,97,97,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96 -100,101,102,102,103,103,104,104,105,106,106,107,106,106,106,105,105,104,103,103,104,105,107,108,110,111,111,112,112,113,113,112,111,110,108,107,106,105,100,100,100,98,97,97,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96 -100,101,101,102,102,103,103,104,104,105,105,105,105,106,105,105,104,103,102,101,102,103,104,106,107,110,111,111,111,112,112,112,110,107,107,106,105,102,100,100,99,98,97,97,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,95 -99,100,101,102,102,103,103,103,104,104,104,104,103,104,104,104,104,102,101,101,102,103,104,105,107,110,111,111,111,111,111,111,108,106,105,105,102,101,100,99,99,98,97,97,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,95,95 -99,100,100,101,101,102,102,102,103,103,103,103,102,103,103,104,103,102,101,101,101,102,103,104,106,109,110,111,111,111,110,110,107,105,103,104,100,100,99,99,98,98,97,97,96,96,96,96,96,96,96,96,96,96,95,95,95,95,95,95,95 -99,100,100,100,101,101,101,102,102,103,102,102,101,102,102,103,103,101,101,100,101,101,102,103,105,109,110,110,111,110,110,109,106,105,100,102,100,99,99,99,98,98,97,97,96,96,96,96,96,96,95,95,95,95,95,95,95,95,95,95,94 -99,99,99,99,100,100,101,101,102,102,101,101,101,101,101,102,102,101,100,100,101,101,101,103,104,107,109,109,110,110,109,108,105,102,100,100,99,99,99,98,98,98,97,96,96,96,96,96,95,95,95,95,95,95,95,94,94,94,94,94,94 -98,99,99,99,99,100,100,101,101,102,101,100,100,100,101,101,101,100,100,100,100,101,101,101,103,106,107,109,109,109,109,107,104,101,100,99,99,99,98,98,98,97,96,96,96,96,95,95,95,95,95,95,95,94,94,94,94,94,94,94,94 -98,98,98,99,99,99,100,100,101,101,100,100,99,99,100,100,100,100,100,100,100,101,101,101,102,105,106,109,108,109,107,105,102,100,100,99,99,98,98,98,97,96,96,96,96,95,95,95,95,95,95,94,94,94,94,94,94,94,94,94,94 -97,98,98,98,99,99,99,100,100,100,100,100,99,99,99,100,100,100,100,100,100,100,101,101,101,103,104,105,106,105,104,101,100,100,99,99,98,98,97,97,97,96,96,96,95,95,95,95,95,94,94,94,94,94,94,94,94,94,94,94,94 -97,97,97,98,98,99,99,99,100,100,100,99,99,99,99,99,100,100,100,100,100,100,101,101,100,100,100,100,100,100,100,100,100,100,99,99,98,97,97,97,96,96,96,95,95,95,95,94,94,94,94,94,94,94,94,94,94,94,94,94,94 diff --git a/index.qmd b/index.qmd index 33b21dd8..5bc7b5e1 100755 --- a/index.qmd +++ b/index.qmd @@ -29,12 +29,10 @@ CI <- identical(Sys.getenv("CI"), "true") #| message: false xfun::session_info(packages = c( - "ggplot2", "gganimate", "ggrepel", "ggdensity", - "ggridges", "ggsignif", "ggforce", "ggbeeswarm", - "ggeffects", "ggnewscale", "patchwork", "shiny", - "plotly", "lattice", "igraph", "tidygraph", "ggraph", - "dplyr", "purrr", "tidyr", "httr", "data.table", - "rsconnect", "knitr", "rmarkdown", "gt", "DT", + "ggplot2", "gganimate", "ggrepel", "ggridges", + "patchwork", "shiny", "plotly", "lattice", "igraph", + "tidygraph", "ggraph", "dplyr", "purrr", "tidyr", "httr", + "data.table", "rsconnect", "knitr", "rmarkdown", "gt", "DT", "showtext", "gifski", "tinytex", "magick" ), dependencies = FALSE) ``` diff --git a/preface.qmd b/preface.qmd index 8a99b64f..12bdbe7b 100755 --- a/preface.qmd +++ b/preface.qmd @@ -108,15 +108,13 @@ aggregate(data = dat, weight ~ weight_bucket + group, FUN = length) 2. 数据部分:从本地文件、远程数据库、网页爬取等数据获取方式,筛选、变换、重塑、排序等基础的数据操作,离群值、异常值检测,缺失值处理等基础的数据处理 -3. 展示部分:ggplot2 基础、统计图形、实战应用、经验总结 +3. 交流部分:交互的图形、表格和应用,动态的 HTML 网页、PDF 文档和办公文档。 -4. 交流部分:交互的图形、表格和应用,动态的 HTML 网页、PDF 文档和办公文档。 +4. 统计分析:统计检验、相关分析、分类数据、功效分析 -5. 建模部分:线性模型、广义线性模型、混合效应模型、数据挖掘算法和神经网络模型 +5. 数据建模:网络数据、文本数据、时序数据 -6. 应用部分:网络数据、文本数据、时序数据、空间数据的分析 - -7. 其它部分:参数估计、假设检验和抽样分布等基础的统计推断,L-BFGS 算法、EM 算法等统计计算,自助法、重抽样等统计模拟。 +6. 优化建模:统计计算、数值优化、优化问题 ## 公开数据从哪找? {#sec-finding-public-datasets} @@ -125,10 +123,3 @@ aggregate(data = dat, weight ~ weight_bucket + group, FUN = length) - 各类网站提供的数据集,比如 GitHub 开放数据集列表 [awesome-public-datasets](https://github.com/awesomedata/awesome-public-datasets),[kaggle](https://www.kaggle.com/datasets) 网站提供大量数据分析竞赛及相应的数据集。 - R 包内置数据集,已整理得很好,比如 [**spData**](https://github.com/Nowosad/spData/) 包 收集整理了很多空间统计方面的数据集。[Rdatasets](https://github.com/vincentarelbundock/Rdatasets) 更是收集约 1900 个数据集,全部来自 CRAN 上发布的 R 包。 - 一些 R 包封装数据下载的接口,比如[**tidyBdE**](https://github.com/rOpenSpain/tidyBdE)包可以下载西班牙银行开放的数据,[**WDI**](https://github.com/vincentarelbundock/WDI) 可以下载世界银行开放的数据。 - -## 学会有效地提问? {#sec-asking-the-right-questions} - -- 想清楚自己的问题是什么?尽力做好拆解和界定。 -- 去掉枝叶,保留主干,提供最小的可重复的示例。 -- 有耐心地等待社区的回应,积极地与社区沟通。 -- 为社区提供力所能及的帮助,提升自己的影响力。 diff --git a/visualization-advanced.qmd b/visualization-advanced.qmd deleted file mode 100644 index 3744adac..00000000 --- a/visualization-advanced.qmd +++ /dev/null @@ -1,826 +0,0 @@ -# 统计图形 {#sec-advanced} - -```{r} -#| echo: false - -source("_common.R") -``` - -- @sec-visualize-data-distribution 探索、展示数据中隐含的分布信息,具体有箱线图、提琴图、直方图、密度图、岭线图和抖动图。 -- @sec-visualize-data-relation 探索、展示数据中隐含的相关信息,这种相关具有一般性,比如线性和非线性相关,位序关系、包含关系、依赖关系等,具体有散点图、气泡图、凹凸图、韦恩图、甘特图和网络图。 -- @sec-visualize-data-uncertainty 探索、展示数据中隐含的不确定性,统计中描述不确定性有很多概念,比如置信区间、假设检验中的 P 值,统计模型中的预测值及其预测区间,模型残差隐含的分布,模型参数分量的边际分布及其效应,贝叶斯视角下的模型参数的后验分布。 - -## 描述分布 {#sec-visualize-data-distribution} - -数据来自中国国家统计局发布的2021年统计年鉴,各省、直辖市和自治区分区域的性别比数据(部分)情况见 @tbl-province-sex-ratio 。 - -```{r} -#| label: tbl-province-sex-ratio -#| tbl-cap: "各省、直辖市和自治区分区域的性别比数据(部分)" -#| echo: false - -province_sex_ratio <- readRDS(file = "data/china-sex-ratio-2020.rds") -knitr::kable(head(province_sex_ratio)) -``` - -### 箱线图 {#sec-boxplot} - -```{r} -#| label: fig-ggplot2-boxplot -#| fig-cap: 箱线图的几种绘制形式 -#| fig-subcap: -#| - ggplot2 包 -#| - ggplot2 包(高亮离群值) -#| - lvplot 包 -#| - Base R 包 -#| fig-width: 4.5 -#| fig-height: 4.5 -#| fig-showtext: true -#| par: true -#| layout-ncol: 2 - -library(ggplot2) -ggplot(data = province_sex_ratio, aes(x = `区域`, y = `性别比(女=100)`)) + - geom_boxplot() + - theme_classic() -ggplot(data = province_sex_ratio, aes(x = `区域`, y = `性别比(女=100)`)) + - geom_boxplot(outlier.colour = "red") + - theme_classic() -library(lvplot) -ggplot(data = province_sex_ratio, aes(x = `区域`, y = `性别比(女=100)`)) + - geom_lv() + - theme_classic() -boxplot(`性别比(女=100)` ~ `区域` , data = province_sex_ratio) -``` - -箱线图的历史有 50 多年了,它的变体也有很多,除了 ggplot2 包,**lvplot** 包也可以绘制箱线图的变体 [@Tukey1978]。更多详情见 Hadley Wickham 和 Lisa Stryjewski 的文章 [40 years of boxplots](https://vita.had.co.nz/papers/boxplots.pdf)。 - -### 提琴图 {#sec-violin} - -```{r} -#| label: fig-ggplot2-violin -#| fig-cap: "提琴图" -#| fig-subcap: -#| - 函数 `geom_violin()` -#| - 函数 `geom_violin()` 标记分位点 -#| - vioplot 包 -#| - beanplot 包 -#| fig-width: 4.5 -#| fig-height: 4.5 -#| fig-showtext: true -#| par: true -#| layout-ncol: 2 - -ggplot(data = province_sex_ratio, aes(x = `区域`, y = `性别比(女=100)`)) + - geom_violin(fill = "lightgray") + - theme_classic() -ggplot(data = province_sex_ratio, aes(x = `区域`, y = `性别比(女=100)`)) + - geom_violin(fill = "lightgray", draw_quantiles = c(0.25, 0.5, 0.75)) + - theme_classic() -vioplot::vioplot(`性别比(女=100)` ~ `区域`, - data = province_sex_ratio, col = "lightgray") -beanplot::beanplot(`性别比(女=100)` ~ `区域`, - data = province_sex_ratio, col = "lightgray", log = "", - xlab = "区域", ylab = "性别比(女=100)") -``` - -**beanplot** 包的名字是根据图形的外观取的,bean 即是豌豆,rug 用须线表示数据。 - -### 直方图 {#sec-histogram} - -ggplot2 包绘制直方图的函数是 `geom_histogram()` ,而与之相关的函数 `geom_freqpoly()` 是绘制折线图,将直方图中每个柱子的顶点连接起来。 - -```{r} -#| label: fig-histogram -#| fig-cap: "直方图" -#| fig-subcap: -#| - 函数 `geom_histogram()` -#| - 函数 `geom_freqpoly()` -#| fig-width: 4.5 -#| fig-height: 3.5 -#| fig-showtext: true -#| layout-ncol: 2 - -ggplot(data = province_sex_ratio, aes(x = `性别比(女=100)`, fill = `区域`)) + - geom_histogram(binwidth = 5, color = "white", position = "stack") + - scale_fill_grey() + - theme_classic() + - theme(legend.position = "inside", legend.position.inside = c(0.9, 0.8)) + - labs(y = "频数") -ggplot(data = province_sex_ratio, aes(x = `性别比(女=100)`, color = `区域`)) + - geom_freqpoly(binwidth = 5, stat = "bin", position = "stack") + - scale_color_grey() + - theme_classic() + - theme(legend.position = "inside", legend.position.inside = c(0.9, 0.8)) -``` - -### 密度图 {#sec-density} - -ggplot2 包绘制密度图的函数是 `geom_density()`, @fig-density 展示分组密度曲线图 - -```{r} -#| label: fig-density -#| fig-cap: "密度图" -#| fig-width: 4.5 -#| fig-height: 3.5 -#| fig-showtext: true - -ggplot(data = province_sex_ratio, aes(x = `性别比(女=100)`)) + - geom_density(aes(fill = `区域`), alpha = 0.75) + - scale_fill_grey() + - theme_classic() -``` - -#### 堆积(条件)密度图 {#sec-density-stacked-plot} - -::: callout-caution -Stacked density plots: if you want to create a stacked density plot, you probably want to 'count' (density \* n) variable instead of the default density -::: - -堆积密度图正确的绘制方式是保护边际密度。 - -```{r} -#| label: fig-density-stack -#| fig-cap: "累积分布密度图" -#| fig-subcap: -#| - 堆积密度图 `after_stat(density)` -#| - 堆积密度图 `after_stat(density * n)` -#| fig-width: 4.5 -#| fig-height: 3.5 -#| fig-showtext: true -#| layout-ncol: 2 - -ggplot(data = province_sex_ratio, aes(x = `性别比(女=100)`, y = after_stat(density))) + - geom_density(aes(fill = `区域`), position = "stack", alpha = 0.5) + - scale_fill_grey() + - theme_classic() + - theme(legend.position = "inside", legend.position.inside = c(0.9, 0.8)) -ggplot(data = province_sex_ratio, aes(x = `性别比(女=100)`, y = after_stat(density * n))) + - geom_density(aes(fill = `区域`), position = "stack", alpha = 0.5) + - scale_fill_grey() + - theme_classic() + - theme(legend.position = "inside", legend.position.inside = c(0.9, 0.8)) -``` - -什么原因导致 @fig-density-stack 中两个子图看起来没什么差别呢?而换一组数据,就可以看出明显的差别。 - -```{r} -#| label: fig-density-diamonds -#| fig-cap: "堆积密度图" -#| fig-subcap: -#| - 函数 `after_stat(density)` -#| - 函数 `after_stat(density * n)` -#| fig-width: 4 -#| fig-height: 3 -#| fig-showtext: true -#| layout-ncol: 2 - -ggplot(diamonds, aes(x = carat, y = after_stat(density), fill = cut)) + - geom_density(position = "stack") + - scale_fill_grey() + - theme_classic() + - theme(legend.position = "inside", legend.position.inside = c(0.8, 0.7)) + - labs(x = "克拉", y = "频数", fill = "切工") -ggplot(diamonds, aes(x = carat, y = after_stat(density * n), fill = cut)) + - geom_density(position = "stack") + - scale_fill_grey() + - scale_y_continuous( - breaks = c(25000, 50000, 75000), - labels = c("25K", "50K", "75K")) + - theme_classic() + - theme(legend.position = "inside", legend.position.inside = c(0.8, 0.7)) + - labs(x = "克拉", y = "频数", fill = "切工") -``` - -#### 联合密度图 {#sec-density-2d-joint} - -```{r} -#| label: fig-density-2d -#| fig-cap: "二维联合密度图" -#| fig-width: 5 -#| fig-height: 4 -#| fig-showtext: true - -state_x77 <- data.frame(state.x77, state_name = rownames(state.x77), - state_region = state.region, check.names = FALSE) -p1 <- ggplot(data = state_x77, aes(x = Income, y = `Life Exp`)) + - geom_point() + - geom_density_2d( - aes(color = after_stat(level), alpha = after_stat(level)), show.legend = F - ) + - scale_color_distiller(palette = "Greys") + - labs( - x = "人均收入(美元)", y = "预期寿命(年)", - title = "1977 年各州预期寿命与人均收入的关系", - caption = "数据源:美国人口调查局" - ) + - theme_classic() -p1 -``` - -#### 边际密度图 {#sec-density-margins} - -**ggExtra** 包[@ggExtra2022] 添加边际密度曲线和边际直方图。 - -```{r} -#| label: fig-density-margins -#| fig-cap: "描述边际分布" -#| fig-width: 5 -#| fig-height: 4 -#| fig-showtext: true - -library(ggExtra) -ggMarginal(p1, type = "density") -ggMarginal(p1, type = "histogram") -``` - -#### 填充密度图 {#sec-density-2d-filled} - -**ggplot2** 包提供二维密度图层 `geom_density_2d_filled()` 绘制热力图, [**ggdist**](https://github.com/mjskay/ggdist) [@ggdist2022] 进行了一些扩展。 - -```{r} -#| label: fig-density-2d-filled -#| fig-cap: "ggplot2 包绘制二维填充密度图" -#| fig-width: 5.5 -#| fig-height: 4 -#| fig-showtext: true - -ggplot(data = state_x77, aes(x = Income, y = `Life Exp`)) + - geom_density_2d_filled(contour_var = "count") + - theme_classic() + - labs( - x = "人均收入(美元)", y = "预期寿命(年)", - title = "1977 年各州预期寿命与人均收入的关系", - caption = "数据源:美国人口调查局" - ) -``` - -相比于 **ggplot2** 内置的二维核密度估计,[**ggdensity**](https://github.com/jamesotto852/ggdensity/) [@Otto2023] 有一些优势,根据数据密度将目标区域划分,更加突出层次和边界。[**gghdr**](https://github.com/Sayani07/gghdr) 包与 **ggdensity** 类似,展示 highest density regions (HDR) - -```{r} -#| label: fig-density-hdr -#| fig-cap: "ggdensity 包绘制二维填充密度图" -#| fig-width: 5 -#| fig-height: 4 -#| fig-showtext: true - -library(ggdensity) -ggplot(data = state_x77, aes(x = Income, y = `Life Exp`)) + - geom_hdr() + - geom_point() + - theme_classic() + - labs( - x = "人均收入(美元)", y = "预期寿命(年)", - title = "1977 年各州预期寿命与人均收入的关系", - caption = "数据源:美国人口调查局" - ) -``` - -### 岭线图 {#sec-ridge-line} - -叠嶂图,还有些其它名字,如峰峦图、岭线图等,详情参考统计之都主站[《叠嶂图的前世今生》](https://cosx.org/2018/04/ridgeline-story/),主要用来描述数据的分布情况,在展示分布的对比上效果非常好。 - -@fig-ridge-line 设置窗宽为 1.5 个百分点 - -```{r} -#| label: fig-ridge-line -#| fig-cap: "描述数据分布" -#| fig-subcap: -#| - 岭线图 -#| - 岭线图和抖动图组合 -#| - 岭线图和轴须图组合 -#| layout-ncol: 2 -#| fig-width: 4.5 -#| fig-height: 3.5 -#| echo: false -#| fig-showtext: true - -library(ggridges) -ggplot(data = province_sex_ratio, aes(x = `性别比(女=100)`, y = `区域`)) + - geom_density_ridges(bandwidth = 1.5, alpha = 0.7) + - theme_classic() - -ggplot(data = province_sex_ratio, aes(x = `性别比(女=100)`, y = `区域`)) + - geom_density_ridges(bandwidth = 1.5, jittered_points = TRUE, alpha = 0.7) + - theme_classic() - -ggplot(data = province_sex_ratio, aes(x = `性别比(女=100)`, y = `区域`)) + - geom_density_ridges( - bandwidth = 1.5, - jittered_points = TRUE, - position = position_points_jitter(height = 0), - point_shape = "|", point_size = 3, - point_alpha = 1, alpha = 0.7 - ) + - theme_classic() -``` - -::: callout-tip -除了中国国家统计年鉴,各省、自治区、直辖市及各级统计局每年都会发布一些统计年鉴、公告等数据,读者可以在此基础上继续收集更多数据,来分析诸多有意思的问题: - -1. 城市、镇和乡村男女性别比呈现差异化分布的成因。 -2. 城市、镇和乡村男女年龄构成。 -3. 将上述问题从省级下钻到市、县级来分析。 -::: - -### 抖动图 {#sec-jitter} - -下面先用函数 `geom_point()` 绘制散点图展示原始数据,通过点的疏密程度暗示数据的分布。Base R 函数 `stripchart()` 可以实现类似的效果。当数据量比较大时,点相互覆盖比较严重,此时,抖动图比较适合用来展示原始数据。函数 `geom_beeswarm()` 提供了另一种散点的组织方式,按一定的规则,而不是近似随机的方式组织。 - -```{r} -#| label: fig-ggplot2-stripchart -#| fig-cap: "散点图" -#| fig-subcap: -#| - 函数 `geom_point()` -#| - 函数 `stripchart()` -#| - 函数 `geom_jitter()` -#| - 函数 `geom_beeswarm()` -#| fig-width: 5 -#| fig-height: 4.5 -#| fig-showtext: true -#| par: true -#| layout-ncol: 2 - -ggplot(data = province_sex_ratio, aes(x = `区域`, y = `性别比(女=100)`)) + - geom_point() + - theme_classic() -stripchart( - `性别比(女=100)` ~ `区域`, vertical = TRUE, pch = 1, - data = province_sex_ratio, xlab = "区域") -ggplot(data = province_sex_ratio, aes(x = `区域`, y = `性别比(女=100)`)) + - geom_jitter(width = 0.25) + - theme_classic() -library(ggbeeswarm) -ggplot(data = province_sex_ratio, aes(x = `区域`, y = `性别比(女=100)`)) + - geom_beeswarm() + - theme_classic() -``` - -@SinaPlot2018 提出一种新的方式描述数据的分布,集合抖动图和小提琴图的功能,在给定的分布界限内抖动。数据点受 violin 的曲线限制,蜂群图也是某种形式的抖动图,添加 violin 作为参考边界,与 sina 图是非常类似的。 - -```{r} -#| label: fig-sina -#| fig-cap: "加强版的抖动图" -#| fig-subcap: -#| - ggforce 包的函数 `geom_sina()` -#| - 函数 `geom_sina()` 叠加函数 `geom_violin()` -#| - ggbeeswarm 包的函数 `geom_quasirandom()` -#| - 函数 `geom_quasirandom()` 叠加函数 `geom_violin()` -#| fig-width: 4.5 -#| fig-height: 3.5 -#| fig-showtext: true -#| layout-ncol: 2 - -library(ggforce) -ggplot(data = province_sex_ratio, aes(x = `区域`, y = `性别比(女=100)`)) + - geom_sina() + - theme_classic() -ggplot(data = province_sex_ratio, aes(x = `区域`, y = `性别比(女=100)`)) + - geom_violin() + - geom_sina() + - theme_classic() -library(ggbeeswarm) -ggplot(data = province_sex_ratio, aes(x = `区域`, y = `性别比(女=100)`)) + - geom_quasirandom() + - theme_classic() -ggplot(data = province_sex_ratio, aes(x = `区域`, y = `性别比(女=100)`)) + - geom_violin() + - geom_quasirandom() + - theme_classic() -``` - -## 描述关系 {#sec-visualize-data-relation} - -### 散点图 {#sec-scatter} - -散点图用以描述变量之间的关系,展示原始的数据,点的形态、大小、颜色等都可以随更多变量变化。 - -中国国家统计局 2021 年发布的统计年鉴,2020 年 31 个省、直辖市、自治区的抚养比、文盲率、人口数的关系。 - -```{r} -#| label: tbl-china-raise-illiteracy-scatter -#| tbl-cap: "2020 年各省、直辖市、自治区,总抚养比和文盲率相关数据(部分)" -#| echo: false - -china_raise_illiteracy <- readRDS(file = "data/china-raise-illiteracy-2020.rds") -knitr::kable(head(china_raise_illiteracy[order(china_raise_illiteracy$`人口数`, decreasing = TRUE), ]), - col.names = c( - "地区", "人口数", "15-64岁", "抚养比", - "15岁及以上人口", "文盲人口", "文盲率" - ), - row.names = FALSE -) -``` - -其中,文盲人口是指15岁及以上不识字及识字很少人口,文盲率 = 文盲人口 / 15岁及以上人口,抚养比 = (0-14岁 + 65岁及以上) / 15-64岁人口数。 - -```{r} -#| label: fig-china-raise-illiteracy -#| fig-cap: "文盲率与抚养比的关系" -#| fig-width: 6 -#| fig-height: 4 -#| fig-showtext: true - -library(ggplot2) -ggplot(data = china_raise_illiteracy) + - geom_point(aes(x = `总抚养比`, y = `文盲人口占15岁及以上人口的比重`)) + - theme_classic() + - labs(x = "抚养比(%)", y = "文盲率(%)") -``` - -### 气泡图 {#sec-bubble} - -气泡图在散点图的基础上,添加了散点大小的视觉维度,可以在图上多展示一列数据,下 @fig-china-raise-illiteracy-bubble 新增了人口数变量。此外,在气泡旁边添加地区名称,将气泡填充的颜色也映射给了人口数变量。 - -```{r} -#| label: fig-china-raise-illiteracy-bubble -#| fig-cap: "文盲率和抚养比数据" -#| fig-width: 6 -#| fig-height: 4.5 -#| fig-showtext: true - -library(ggrepel) -library(scales) -ggplot( - data = china_raise_illiteracy, - aes(x = `总抚养比`, y = `文盲人口占15岁及以上人口的比重`) -) + - geom_point(aes(size = `人口数`, color = `人口数`), - alpha = 0.85, pch = 16, - show.legend = c(color = FALSE, size = TRUE) - ) + - scale_size(labels = label_number(scale_cut = cut_short_scale())) + - scale_color_viridis_c(option = "C") + - geom_text_repel( - aes(label = `地区`), size = 3, max.overlaps = 50, - segment.colour = "gray", seed = 2022, show.legend = FALSE - ) + - coord_cartesian(xlim = c(30, 60), ylim = c(0, 10.5), expand = FALSE) + - theme_classic() + - labs(x = "抚养比(%)", y = "文盲率(%)") -``` - -### 凹凸图 {#sec-bump} - -凹凸图描述位置排序关系随时间的变化,比如前年、去年和今年各省的 GDP 排序变化,春节各旅游景点的人流量变化。[**ggbump**](https://github.com/davidsjoberg/ggbump) 包专门用来绘制凹凸图,如 @fig-bump 所示,展示 - -```{r} -#| label: fig-bump -#| fig-cap: "凹凸图" -#| fig-width: 7 -#| fig-height: 3.5 -#| fig-showtext: true - -library(ggbump) -# 位置排序变化 -df <- data.frame( - country = c( - "印度", "印度", "印度", "瑞典", - "瑞典", "瑞典", "德国", "德国", - "德国", "芬兰", "芬兰", "芬兰" - ), - year = c( - 2018, 2019, 2020, 2018, 2019, 2020, - 2018, 2019, 2020, 2018, 2019, 2020 - ), - value = c( - 492, 246, 246, 369, 123, 492, - 246, 369, 123, 123, 492, 369 - ) -) - -library(data.table) -df <- as.data.table(df) -df[, rank := rank(value, ties.method = "random"), by = "year"] - -ggplot(df, aes(year, rank, color = country)) + - geom_point(size = 7) + - geom_text(data = df[df$year == min(df$year), ], - aes(x = year - .1, label = country), size = 5, hjust = 1) + - geom_text(data = df[df$year == max(df$year), ], - aes(x = year + .1, label = country), size = 5, hjust = 0) + - geom_bump(linewidth = 2, smooth = 8) + - scale_x_continuous(limits = c(2017.6, 2020.4), breaks = seq(2018, 2020, 1)) + - theme_minimal(base_size = 14) + - theme(legend.position = "none", panel.grid.major = element_blank()) + - labs(x = NULL, y = "排名") + - scale_y_reverse() + - coord_fixed(ratio = 0.5) -``` - -### 韦恩图 {#sec-venn-diagram} - -韦恩图描述集合、群体的交叉关系,整体和部分的包含关系,[**ggVennDiagram**](https://github.com/gaospecial/ggVennDiagram/) 包展示 A、B、C 三个集合的交叉关系,如 @fig-venn 所示 - -```{r} -#| label: fig-venn -#| fig-cap: "A、B、C 三个集合的交叉关系" -#| fig-width: 5 -#| fig-height: 4.5 -#| fig-showtext: true - -x <- list(A = 1:5, B = 2:7, C = 5:10) -ggVennDiagram::ggVennDiagram(x) + - scale_fill_gradient(low = "#F4FAFE", high = "#4981BF") -``` - -### 网络图 {#sec-network} - -[**tidygraph**](https://github.com/thomasp85/tidygraph) 包基于 igraph 包操作图数据,计算网络图中节点重要性,[**ggraph**](https://github.com/thomasp85/ggraph)包基于 ggplot2 包可视化网络关系。 - -```{r} -library(ggraph) -data("highschool") -str(highschool) -``` - -highschool 是一个数据框类型的数据,记录了1957 年和 1958 年一些高中男生之间的关系,在数据集中,这些男生被编码成数字 1-71。 - -```{r} -highschool[highschool$from == 1, ] -``` - -1 号男生在 1957 年与 14、15、21、54、55 男生关系密切,到了 1958 年,他与 15、21、22 关系比较密切。tidygraph 包在 igraph 的基础上,可以对图数据进行操作,下面先将数据框转化为图,然后计算中心度,作为高中生的受欢迎程度。 - -```{r} -graph <- tidygraph::as_tbl_graph(highschool, directed = TRUE) |> - dplyr::mutate(Popularity = tidygraph::centrality_degree(mode = 'in')) -graph -``` - -```{r} -#| label: fig-school-graph -#| fig-cap: "高中男生间关系的变化" -#| fig-width: 7 -#| fig-height: 4.5 -#| fig-showtext: true - -ggraph(graph, layout = "kk") + - geom_edge_fan(aes(alpha = after_stat(index)), show.legend = FALSE) + - geom_node_point(aes(size = Popularity)) + - facet_edges(~year) + - theme_graph(base_family = "sans", foreground = "steelblue", fg_text_colour = "white") -``` - -## 描述不确定性 {#sec-visualize-data-uncertainty} - -统计是一门研究不确定性的学科,由不确定性引出许多的基本概念,比如用置信区间描述点估计的不确定性,用覆盖概率描述区间估计方法的优劣。下面以二项分布参数的点估计与区间估计为例,通过可视化图形介绍这一系列统计概念。就点估计来说,描述不确定性可以用标准差、置信区间。 - -[**ggdist**](https://github.com/mjskay/ggdist) 包可视化分布和不确定性 [@ggdist2022] - -- Michael Friendly 2021 年的课程 [Psychology of Data Visualization](http://euclid.psych.yorku.ca/www/psy6135/) -- Claus O. Wilke 2023 年的课程 [SDS 375 Schedule Spring 2023](https://wilkelab.org/SDS375/schedule.html) - -### 置信区间 {#sec-confidence-interval} - -| 0 | 1 | 2 | $\cdots$ | n | -|:------|:------|:------|:---------|:------| -| $p_0$ | $p_1$ | $p_2$ | $\cdots$ | $p_n$ | - -: 二项分布的分布列 {#tbl-binom} - -二项分布 $\mathrm{Binomial}(n,p)$ 的参数 $p$ 的精确区间估计如下: - -$$ -\big(\mathrm{Beta}(\frac{\alpha}{2}; x, n-x+1), \mathrm{Beta}(1-\frac{\alpha}{2}; x+1, n-x)\big) -$$ {#eq-clopper-ci} - -其中, $x$ 表示成功次数,$n$ 表示实验次数,$\mathrm{Beta}(p;v,w)$ 表示形状参数为 $v$ 和 $w$ 的 Beta 贝塔分布的 $p$ 分位数,参数 $p$ 的置信区间的上下限 $P_L,P_U$ 满足 - -$$ -\begin{aligned} -\frac{\Gamma(n+1)}{\Gamma(x)\Gamma(n-x+1)}\int_{0}^{P_L}t^{x-1}(1-t)^{n-x}\mathrm{dt} &= \frac{\alpha}{2} \\ -\frac{\Gamma(n+1)}{\Gamma(x+1)\Gamma(n-x)}\int_{0}^{P_U}t^{x}(1-t)^{n-x-1}\mathrm{dt} &= 1-\frac{\alpha}{2} -\end{aligned} -$$ - -$p_x$ 表示二项分布 $\mathrm{Binomial}(n,p)$ 第 $x$ 项的概率,$x$ 的取值为 $0,1,\cdots,n$ - -$$p_x = \binom{n}{x}p^x(1-p)^{n-x}, \quad x = 0,1,\cdots,n$$ - -二项分布的累积分布函数和 $S_k$ 表示前 $k$ 项概率之和 - -$$S_k = \sum_{x=0}^{k} p_x$$ - -$S_k$ 服从形状参数为 $n-k,k+1$ 的贝塔分布 $I_x(a,b)$,对应于 R 函数 `pbeta(x,a,b)`。 $S_k$ 看作贝塔分布的随机变量 $X$ - -$$ -\begin{aligned} -B_x(a,b) &=\int_{0}^{x}t^{a-1}(1-t)^{b-1}\mathrm{dt} \\ -I_x(a,b) &= \frac{B_x(a,b)}{B(a,b)}, \quad B(a,b) = B_1(a,b) -\end{aligned} -$$ - -考虑二项总体的参数 $p=0.7$,重复模拟 50 次,每次模拟获得的比例 $\hat{p}$ 及其置信区间,区间估计方法来自 [@Clopper1934] ,函数 `binom.test()` 也是采用此方法,二者计算结果相同。如 @fig-clopper-pearson-ci 所示,置信区间覆盖真值的情况用不同颜色表示,覆盖用灰色表示,没有覆盖用黑色表示。 - -```{r} -#| label: fig-clopper-pearson-ci -#| fig-cap: "Clopper-Pearson 置信区间" -#| fig-width: 7 -#| fig-height: 4 -#| fig-showtext: true - -clopper_pearson <- function(p = 0.1, n = 10, nsim = 100) { - set.seed(2022) - nd <- rbinom(nsim, prob = p, size = n) - ll <- qbeta(p = 0.05 / 2, shape1 = nd, shape2 = n - nd + 1) - ul <- qbeta(p = 1 - 0.05 / 2, shape1 = nd + 1, shape2 = n - nd) - data.frame(nd = nd, ll = ll, ul = ul, cover = ul > p & ll < p) -} -# 二项分布的参数 p = 0.7 -dat <- clopper_pearson(p = 0.7, n = 10, nsim = 50) -# 二项分布的参数的置信区间覆盖真值的情况 -ggplot(data = dat, aes(x = 1:50, y = nd / 10, colour = cover)) + - geom_hline(yintercept = 0.7, lty = 2, linewidth = 1.2, color = "gray") + - geom_pointrange(aes(ymin = ll, ymax = ul)) + - scale_color_grey(labels = c(`TRUE` = "是", `FALSE` = "否")) + - theme_classic() + - labs(x = "n", y = "p", color = "覆盖") -``` - -图中,横坐标表示模拟次数 $n$ ,纵坐标表示对应的成功概率 $p$ ,线段端点表示置信区间上下限。 - -### 假设检验 {#sec-hypothesis-tests} - -假设检验的目的是做决策,决策是有风险的,是可能发生错误的,为了控制犯第一类错误的可能性,我们用 P 值描述检验统计假设的不确定性,用功效描述检验方法的优劣。对同一个统计假设,同一组数据,不同的检验方法有不同的 P 值,本质是检验方法的功效不同。 - -[**ggpval**](https://github.com/s6juncheng/ggpval) 在图上添加检验的 P 值结果,[**ggsignif**](https://github.com/const-ae/ggsignif) [@ggsignif2021] 在图上添加显著性注释。[**ggstatsplot**](https://github.com/IndrajeetPatil/ggstatsplot) [@Indrajeet2021] 可视化统计检验、模型的结果,描述功效变化。[**ggpubr**](https://github.com/kassambara/ggpubr) 制作出版级统计图形,两样本均值的比较。 - -```{r} -#| label: fig-plant-growth -#| echo: true -#| fig-cap: "植物生长" -#| fig-width: 5 -#| fig-height: 3.5 -#| fig-showtext: true - -with( - aggregate( - data = PlantGrowth, weight ~ group, - FUN = function(x) c(dist_mean = mean(x), dist_sd = sd(x)) - ), - cbind.data.frame(weight, group) -) |> - ggplot(aes(x = group, y = dist_mean)) + - geom_col( - position = position_dodge(0.4), width = 0.4, fill = "gray" - ) + - geom_errorbar(aes(ymin = dist_mean - dist_sd, ymax = dist_mean + dist_sd), - position = position_dodge(0.4), width = 0.2) + - theme_classic() + - labs(x = "组别", y = "植物干重") -``` - -::: callout-note -R 3.5.0 以后,函数 `aggregate()` 的参数 `drop` 默认值为 `TRUE`, 表示扔掉未用来分组的变量,聚合返回的是一个矩阵类型的数据对象。 -::: - -单因素方差分析 `oneway.test()` 检验各组的方差是否相等。 - -```{r} -oneway.test(data = PlantGrowth, weight ~ group) -``` - -结果显示方差不全部相等,因此,采用函数 `t.test(var.equal = FALSE)` 来检验数据。@fig-signif 展示假设检验的结果,分别标记了 ctrl 与 trt1、trt1 与 trt2 两组 t 检验的结果。 - -```{r} -#| label: fig-signif -#| fig-cap: "展示假设检验的结果" -#| fig-width: 5 -#| fig-height: 4 -#| fig-showtext: true - -library(ggsignif) -ggplot(data = PlantGrowth, aes(x = group, y = weight)) + - geom_boxplot(width = 0.25) + - geom_jitter(width = 0.15) + - geom_signif(comparisons = list(c("ctrl", "trt1"), c("trt1", "trt2")), - map_signif_level = function(p) sprintf("p = %.2g", p), - textsize = 6, test = "t.test") + - theme_classic() + - coord_cartesian(clip = "off") -``` - -为了了解其中的原理,下面分别使用函数 `t.test()` 检验数据,结果给出的 P 值与上 @fig-signif 完全一样。 - -```{r} -t.test(data = PlantGrowth, weight ~ group, subset = group %in% c("ctrl", "trt1")) -t.test(data = PlantGrowth, weight ~ group, subset = group %in% c("trt1", "trt2")) -``` - -### 模型预测 {#sec-model-predictions} - -描述模型预测的不确定性,预测的方差、预测区间。线性回归来说,回归线及置信带。代码提交量的趋势拟合 - -```{r} -#| label: fig-smooth -#| fig-cap: "趋势拟合、预测和推断" -#| fig-width: 7 -#| fig-height: 4.5 -#| fig-showtext: true - -svn_trunk_log <- readRDS(file = "data/svn-trunk-log-2022.rds") -svn_trunk_log$year <- as.integer(format(svn_trunk_log$stamp, "%Y")) -trunk_year <- aggregate(data = svn_trunk_log, revision ~ year, FUN = length) -ggplot(data = trunk_year[trunk_year$year != 1997,], aes(x = year, y = revision)) + - geom_point() + - geom_smooth(aes(color = "LOESS", fill = "LOESS"), - method = "loess", formula = "y~x", - method.args = list( - span = 0.75, degree = 2, family = "symmetric", - control = loess.control(surface = "direct", iterations = 4) - )) + - geom_smooth(aes(color = "GAM", fill = "GAM"), - formula = y ~ s(x, k = 12), method = "gam", se = TRUE) + - geom_smooth(aes(color = "Cubic Spline", fill = "Cubic Spline"), - method = "lm", formula = y ~ splines::bs(x, 3), se = T) + - scale_color_brewer(name = "模型", palette = "Set1") + - scale_fill_brewer(name = "模型", palette = "Set1") + - theme_classic() + - theme(panel.grid.major.y = element_line(colour = "gray90")) + - labs(x = "年份", y = "提交量") -``` - -### 模型诊断 {#sec-model-diagnostics} - -> 所有模型都是错误的,但有些是有用的。 -> -> --- 乔治·博克斯 - -描述模型的敏感性,数据中存在的离群值,变量之间的多重共线性等。引入 Cook 距离、杠杆值、VIF 等来诊断模型。 - -```{r} -#| label: fig-lm-diagnostics -#| fig-cap: "线性模型的诊断图" -#| fig-showtext: true -#| collapse: true -#| fig-width: 7 -#| fig-height: 8 - -# 准备数据 -state_x77 <- data.frame(state.x77, - state_name = rownames(state.x77), state_region = state.region, - state_abb = state.abb, check.names = FALSE -) -# 线性模型拟合 -fit <- lm(`Life Exp` ~ Income + Murder, data = state_x77) -# 模型诊断图 -library(ggfortify) -autoplot(fit, which = 1:6, label.size = 3) -``` - -对于复杂的统计模型,比如混合效应模型的诊断,[**ggPMX**](https://github.com/ggPMXdevelopment/ggPMX) 包。 - -```{r} -#| echo: false -#| eval: false - -op <- par(mfrow = c(3, 2), mar = c(4, 4, 3, 1)) -plot(fit, - ask = FALSE, which = c(1, 2, 3, 4, 5, 6), - caption = list( - "残差和拟合值", "正态 Q-Q 图", - "尺度-位置", "Cook 距离", "残差和杠杆值", - expression("Cook 距离 vs 杠杆值" * h[ii] / (1 - h[ii])) - ) -) -par(op) -``` - -### 边际效应 {#sec-marginal-effects} - -继续 state_x77 数据集,以预期寿命(1969-1971 年统计)为因变量,Income 人均收入(1974 年)和 Murder 谋杀和非过失杀人率(单位:十万分之一,1976 年统计)为自变量,建立线性模型如下: - -$$ -\text{Life Exp} = \alpha + \beta_1 \text{Income} + \beta_2 \text{Murder} + \epsilon -$$ {#eq-lm-state-x77} - -在 R 语言中,可以用函数 `lm()` 拟合上述模型, - -```{r} -fit <- lm(`Life Exp` ~ Income + Murder, data = state_x77) -``` - -模型拟合结果输出如下: - -```{r} -summary(fit) -``` - -[**ggeffects**](https://github.com/strengejacke/ggeffects) 描述单个自变量的作用,人均收入对预期寿命的边际效应 - -```{r} -#| label: fig-marginal-effects -#| fig-cap: "边际效应" -#| fig-width: 5 -#| fig-height: 4 -#| fig-showtext: true - -library(ggeffects) -income_pred <- ggpredict(fit, terms = "Income") -ggplot(income_pred, aes(x, predicted)) + - geom_line() + - geom_ribbon(aes(ymin = conf.low, ymax = conf.high), alpha = 0.1) + - theme_classic() + - labs(x = "人均收入", y = "预期寿命") -``` diff --git a/visualization-basic.qmd b/visualization-basic.qmd deleted file mode 100755 index 34ea7d33..00000000 --- a/visualization-basic.qmd +++ /dev/null @@ -1,809 +0,0 @@ -# ggplot2 入门 {#sec-basic} - -```{r} -#| echo: false - -source("_common.R") -``` - -2006 年 Hans Rosling(汉斯·罗琳)在 TED 做了一场精彩的演讲 --- The best stats you've ever seen。演讲中展示了一系列生动形象的动画,用数据记录的事实帮助大家理解世界的变化,可谓是动态图形领域的惊世之作。时至今日,已经超过 1500 万人观看,产生了十分广泛的影响。下面从数据源头 --- 世界银行获取数据,整理后取名 `gapminder`。本节将基于 `gapminder` 数据集介绍 **ggplot2** 绘图的基础知识,包括图层、标签、刻度、配色、图例、主题、文本、分面、字体、动画和组合等 11 个方面,理解这些有助于绘制和加工各种各样的统计图形,可以覆盖日常所需。gapminder 数据集以数据框的形式存储在 R 软件运行环境中,一共 4950 行,7 列。篇幅所限,下 @tbl-gapminder 展示该数据集的部分内容,表中人均 GDP 和预期寿命两列四舍五入保留一位小数。 - -```{r} -#| echo: false -#| label: tbl-gapminder -#| tbl-cap: "gapminder 数据集(部分)" - -gapminder <- readRDS(file = "data/gapminder-2020.rds") -knitr::kable(head(gapminder), digits = 1, - col.names = c( - "年份", "国家或地区", "区域划分", "收入水平", - "人均 GDP", "预期寿命", "人口总数" - ) -) -``` - -在 R 环境中,加载 gapminder 数据集后,可以用 `str()` 函数查看数据集 gapminder 各个列的数据类型和部分属性值。 - -```{r} -#| label: load-gapminder - -# 查看数据 -str(gapminder) -``` - -其中,country(国家或地区)是字符型变量,region (区域)是因子型变量,income_level(收入水平)是有序的因子型变量,year (年份)、 pop (人口总数)、lifeExp (出生时的预期寿命,单位:岁)和 gdpPercap (人均 GDP,单位:美元)是数值型变量。 - -## 图层 {#sec-layer} - -ggplot2 绘图必须包含以下三个要素,缺少任何一个,图形都是不完整的。 - -1. 数据,前面已经重点介绍和准备了; -2. 映射,数据中的变量与几何元素的对应关系; -3. 图层,至少需要一个图层用来渲染观察值。 - -下面逐一说明三个要素的作用,为简单起见,从数据集 gapminder 中选取 2007 年的数据。 - -```{r} -#| label: fig-layer-point -#| fig-cap: "ggplot2 绘图三要素" -#| fig-subcap: -#| - "只有数据" -#| - "只有数据和坐标映射" -#| - "数据、坐标映射和点图层" -#| - "数据、坐标映射、点图层和视觉映射(可选)" -#| layout-ncol: 2 -#| layout-nrow: 2 -#| fig-width: 4 -#| fig-height: 3 -#| fig-showtext: true - -library(ggplot2) -gapminder_2007 <- gapminder[gapminder$year == 2007, ] -ggplot(data = gapminder_2007) -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + - geom_point() -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + - geom_point(aes(size = pop)) -``` - -@fig-layer-point-1 仅提供数据,只渲染出来一个绘图区域。 @fig-layer-point-2 仅提供数据和映射,将变量 gdpPercap 映射给横轴,变量 lifeExp 映射给纵轴,继续渲染出来横、纵坐标轴及标签。 @fig-layer-point-3 提供了数据、映射和图层三要素,观察值根据几何图层 `geom_point()` 将几何元素 「点」渲染在绘图区域上,形成散点图。函数 `ggplot()` 和函数 `geom_point()` 之间是以加号 `+` 连接的。无论最终产出的图形如何复杂,这个模式贯穿 ggplot2 绘图。 - -10 多年来,**ggplot2** 包陆续添加了很多几何图层,目前支持的有 53 个,如下: - -```{r} -#| eval: false -#| echo: false -#| label: layout-geom - -library(ggplot2) -knitr::kable(matrix(grep("^geom_*", x = ls("package:ggplot2"), value = T), ncol = 3), - col.names = c("A", "B", "C"), caption = "图层", format = "pipe" -) -``` - -| | | | -|:-----------------------|:----------------|:--------------| -| geom_abline | geom_dotplot | geom_qq_line | -| geom_area | geom_errorbar | geom_quantile | -| geom_bar | geom_errorbarh | geom_raster | -| geom_bin_2d | geom_freqpoly | geom_rect | -| geom_bin2d | geom_function | geom_ribbon | -| geom_blank | geom_hex | geom_rug | -| geom_boxplot | geom_histogram | geom_segment | -| geom_col | geom_hline | geom_sf | -| geom_contour | geom_jitter | geom_sf_label | -| geom_contour_filled | geom_label | geom_sf_text | -| geom_count | geom_line | geom_smooth | -| geom_crossbar | geom_linerange | geom_spoke | -| geom_curve | geom_map | geom_step | -| geom_density | geom_path | geom_text | -| geom_density_2d | geom_point | geom_tile | -| geom_density_2d_filled | geom_pointrange | geom_violin | -| geom_density2d | geom_polygon | geom_vline | -| geom_density2d_filled | geom_qq | | - -: **ggplot2** 包可以绘制丰富的统计图形 {#tbl-ggplot2-layers} - -也正因这些丰富多彩的图层,ggplot2 可以非常便捷地做各种数据探索和展示工作。从时间序列数据、网络社交数据到文本数据、空间数据,乃至时空数据都有它大显身手的地方。 - -## 标签 {#sec-label} - -用函数 `labs()` 可以添加横轴、纵轴、图例的标题,整个图片的标题和副标题等。下图 @fig-label-1 是默认设置下显示的标签内容,而 @fig-label-2 是用户指定标签内容后的显示效果。 - -```{r} -#| label: fig-label -#| fig-width: 7 -#| fig-height: 3.5 -#| fig-cap: "添加标签" -#| fig-subcap: -#| - "默认设置" -#| - "自定义标签" -#| layout-ncol: 1 -#| fig-showtext: true - -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + - geom_point(aes(color = region)) -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + - geom_point(aes(color = region)) + - labs(x = "人均 GDP", y = "预期寿命", tag = "标签", - title = "这里是标题", caption = "这是图形说明", - subtitle = "这里是副标题", color = "图例标题") -``` - -## 刻度 {#sec-scale} - -```{=html} - -``` -有时候 @fig-layer-point-3 看起来不太好,收入低的国家太多,聚集在一起,重叠覆盖比较严重。而高收入国家相对较少,分布稀疏,距离低收入比较远,数据整体的分布很不平衡。此时,可以考虑对横轴标度做一些变换,常用的有以 10 为底的对数变换,如 @fig-scale-log10 。 - -```{r} -#| label: fig-scale-log10 -#| fig-showtext: true -#| fig-width: 5 -#| fig-height: 3 -#| fig-cap: "人均 GDP 做对数变换" - -library(scales) -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + - geom_point() + - scale_x_log10() + - labs(x = "人均 GDP", y = "预期寿命") -``` - -为了更加醒目地展示横轴做了对数变换,需要添加对应的刻度标签。**scales** 包 [@scales2022] 提供很多刻度标签支持,比如函数 `label_log()` 默认提供以 10 为底的刻度标签,如 @fig-scale-labels 。 - -```{r} -#| label: fig-scale-labels -#| fig-showtext: true -#| fig-cap: "刻度标签随数据变换调整" -#| fig-width: 5 -#| fig-height: 3 - -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + - geom_point() + - scale_x_log10(labels = label_log()) + - labs(x = "人均 GDP", y = "预期寿命") -``` - -这其实还不够,有的刻度标签含义不够显然,且看 @fig-scale-labels 的横轴第一个刻度标签 $10^{2.48}$ 是用来替换 @fig-scale-log10 的横轴第一个刻度标签 300。10 的 2.48 次方可不容易看出是 300 的意思,实际上它等于 302。因此,结合人均 GDP 的实际范围,有必要适当调整横轴显示范围,这可以在函数 `scale_x_log10()` 中设置参数 `limits`,横轴刻度标签会随之适当调整,调整后的效果如 @fig-scale-limits 。 - -```{r} -#| label: fig-scale-limits -#| fig-showtext: true -#| fig-width: 5 -#| fig-height: 3 -#| fig-cap: "设置数据展示范围" - -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + - geom_point() + - scale_x_log10(labels = label_log(), limits = c(100, 110000)) + - labs(x = "人均 GDP", y = "预期寿命") -``` - -根据横轴所代表的人均 GDP (单位:美元)的实际含义,其实,可以进一步,添加更多的信息,即刻度标签带上数量单位,此处是美元符号。**scales** 包提供的函数 `label_dollar()` 可以实现,效果如 @fig-scale-dollar 。 - -```{r} -#| label: fig-scale-dollar -#| fig-showtext: true -#| fig-width: 5 -#| fig-height: 3 -#| fig-cap: "设置数据展示范围" - -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + - geom_point() + - scale_x_log10(labels = label_dollar(), limits = c(100, 110000)) + - labs(x = "人均 GDP", y = "预期寿命") -``` - -最后,有必要添加次刻度线作为辅助参考线。图中点与点之间的横向距离代表人均 GDP 差距,以 10 为底的对数变换不是线性变化的,肉眼识别起来有点困难。从 100 美元到 100000 美元,在 100 美元、1000 美元、10000 美元和 100000 美元之间均添加 10 条次刻度线,每个区间内相邻的两条次刻度线之差保持恒定。下面构造刻度线的位置,了解原值和对数变换后的对应关系。 - -```{r} -# 刻度线位置 -mb <- unique(as.numeric(1:10 %o% 10^(1:4))) -# 对数变换后 -log10(mb) -# 刻度线位置 -format(mb, big.mark = ",", scientific = 999) -``` - -函数 `scale_x_log10()` 提供参数 `minor_breaks` 设定刻度线的位置。最终效果如 @fig-scale-minor-breaks 。 - -```{r} -#| label: fig-scale-minor-breaks -#| fig-showtext: true -#| fig-width: 5 -#| fig-height: 3 -#| fig-cap: "添加次刻度线,提供更多参考" - -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + - geom_point() + - scale_x_log10( - labels = label_dollar(), minor_breaks = mb, limits = c(100, 110000) - ) + - labs(x = "人均 GDP", y = "预期寿命") -``` - -## 配色 {#sec-color} - -好的配色可以让图形产生眼前一亮的效果,R 语言社区在统计图形领域深耕 20 多年,陆续涌现很多专门调色的 R 包,常见的有: - -- **RColorBrewer** [@RColorBrewer2022] () -- **munsell** [@munsell2018] () -- **colorspace** [@Zeileis2020] () -- **paletteer** [@paletteer2021] () -- **scico** [@scico2022] () -- **viridis** [@viridis2021] () -- **viridisLite** [@viridis2021] () -- **colormap** [@colormap2016] () - -**ggplot2** 提供多种方式给图形配色,最常见的要数函数 `scale_color_brewer()`,它调用 RColorBrewer 包制作离散型的调色板,根据离散型变量的具体情况,可分为发散型 qualitative、对撞型 Diverging、有序型 Sequential。在图 @fig-scale-minor-breaks 的基础上,将分类型的区域变量映射给散点的颜色,即得到 @fig-color-brewer 。 - -```{r} -#| label: fig-color-brewer -#| fig-cap: "使用 RColorBrewer 包提供的 Set1 调色板" -#| fig-showtext: true -#| fig-width: 7 -#| fig-height: 3.5 - -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + - geom_point(aes(color = region)) + - scale_color_brewer(palette = "Set1") + - scale_x_log10( - labels = label_dollar(), minor_breaks = mb, limits = c(100, 110000) - ) + - labs(x = "人均 GDP", y = "预期寿命", color = "区域") -``` - -另一种方式是调用函数 `scale_color_manual()`,需要用户给分类变量值逐个指定颜色,即提供一个命名的向量,效果如 @fig-color-manual 。 - -```{r} -#| label: fig-color-manual -#| fig-cap: "手动挨个指定分类变量的颜色" -#| fig-showtext: true -#| fig-width: 7 -#| fig-height: 3.5 - -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + - geom_point(aes(color = region)) + - scale_color_manual(values = c( - `拉丁美洲与加勒比海地区` = "#E41A1C", `撒哈拉以南非洲地区` = "#377EB8", - `欧洲与中亚地区` = "#4DAF4A", `中东与北非地区` = "#984EA3", - `东亚与太平洋地区` = "#FF7F00", `南亚` = "#FFFF33", `北美` = "#A65628" - )) + - scale_x_log10( - labels = label_dollar(), minor_breaks = mb, limits = c(100, 110000) - ) + - labs(x = "人均 GDP", y = "预期寿命", color = "区域") -``` - -## 图例 {#sec-legend} - -在 @fig-color-brewer 的基础上,继续将每个国家的人口总数映射给点的大小,绘制气泡图。此时有两个视觉映射变量 --- 离散型的变量 country (国家)和连续型的变量 pop (人口总数)。不仅仅是图层函数 `geom_point()`,所有的几何图层都提供参数 `show.legend` 来控制图例的显示或隐藏。传递命名逻辑向量还可以在多个图例中选择性保留。 @fig-legend-show 在两个图例中保留一个,即人口总数。 - -```{r} -#| label: fig-legend-show -#| fig-cap: "在两个图例中保留一个" -#| fig-showtext: true -#| fig-width: 6 -#| fig-height: 3.5 - -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + - geom_point(aes(color = region, size = pop), - show.legend = c(color = FALSE, size = TRUE) - ) + - scale_color_manual(values = c( - `拉丁美洲与加勒比海地区` = "#E41A1C", `撒哈拉以南非洲地区` = "#377EB8", - `欧洲与中亚地区` = "#4DAF4A", `中东与北非地区` = "#984EA3", - `东亚与太平洋地区` = "#FF7F00", `南亚` = "#FFFF33", `北美` = "#A65628" - )) + - scale_size(range = c(2, 12)) + - scale_x_log10( - labels = label_dollar(), minor_breaks = mb, limits = c(100, 110000) - ) + - labs(x = "人均 GDP", y = "预期寿命", size = "人口总数") -``` - -全世界各个国家的人口总数从百万级横跨到十亿级,根据此实际情况,适当调整图例刻度标签是很有必要的,可以让图例内容更具可读性。 @fig-legend-label 是修改图例刻度标签后的效果,其中 M 表示 Million(百万),B 表示 Billion (十 亿)。 - -```{r} -#| label: fig-legend-label -#| fig-cap: "修改图例刻度标签" -#| fig-showtext: true -#| fig-width: 6 -#| fig-height: 3.5 - -ggplot(data = gapminder_2007, aes(x = gdpPercap, y = lifeExp)) + - geom_point(aes(color = region, size = pop), - show.legend = c(color = FALSE, size = TRUE) - ) + - scale_color_manual(values = c( - `拉丁美洲与加勒比海地区` = "#E41A1C", `撒哈拉以南非洲地区` = "#377EB8", - `欧洲与中亚地区` = "#4DAF4A", `中东与北非地区` = "#984EA3", - `东亚与太平洋地区` = "#FF7F00", `南亚` = "#FFFF33", `北美` = "#A65628" - )) + - scale_size(range = c(2, 12), labels = label_number(scale_cut = cut_short_scale())) + - scale_x_log10( - labels = label_dollar(), minor_breaks = mb, limits = c(100, 110000) - ) + - labs(x = "人均 GDP", y = "预期寿命", size = "人口总数") -``` - -## 主题 {#sec-theme} - -主题就是一系列风格样式的集合,提前设定标题、文本、坐标轴、图例等元素的默认参数,供后续调用。10 年来,R 语言社区陆续出现很多主题包。 - -- **ggthemes** [@ggthemes2021] 收集了网站(如 Fivethirtyeight)、杂志(如《经济学家》)、软件(如 Stata)等的配色主题,打包成可供 **ggplot2** 绘图的主题,更多内容见 () -- **ggsci** [@ggsci2018] 包收集了多份期刊杂志的图形配色,将其融入 **ggplot2** 绘图主题中,更多内容见 ()。 -- **ggpubr** [@ggpubr2022] 包在 **ggplot2** 之上封装一套更加易用的函数,可以快速绘制出版级的统计图形 ()。 -- **ggcharts** [@ggcharts2020] 包类似 **ggpubr** 包,也提供一套更加快捷的函数接口,缩短数据可视化的想法与实际图形的距离,更多内容见 ()。 -- **ggthemr** [@ggthemr2020] 是比较早的 **ggplot2** 主题包,上游依赖少,更多内容见 ()。 -- **ggtech** [@ggtech2018] 包收集了许多科技公司的设计风格,将其制作成可供 ggplot2 绘图使用的主题,更多内容见 ()。 -- **bbplot** [@bbplot2022] 为 BBC 新闻定制的一套主题,更多内容见 ()。 -- **pilot** [@pilot2022] 包提供一套简洁的 **ggplot2** 主题,特别是适合展示分类、离散型数据,更多内容见 ()。 -- **ggthemeassist** [@ggThemeAssist2016] 包提供 RStudio IDE 插件,帮助用户以鼠标点击的交互方式设置 **ggplot2** 图形的主题样式,更多内容见 ()。 - -在 @fig-legend-label 的基础上,以 **ggplot2** 包内置的主题 `theme_classic()` 替换默认的主题,效果如下 @fig-theme-classic ,这是一套非常经典的主题,它去掉所有的背景色和参考系,显得非常简洁。 - -```{r} -#| label: fig-theme-classic -#| fig-cap: "ggplot2 内置的经典主题风格" -#| fig-showtext: true -#| fig-width: 6 -#| fig-height: 4.5 - -ggplot(data = gapminder, aes(x = gdpPercap, y = lifeExp)) + - geom_point( - data = function(x) subset(x, year == 2007), - aes(fill = region, size = pop), shape = 21, col = "white", - show.legend = c(fill = TRUE, size = FALSE) - ) + - scale_fill_manual(values = c( - `拉丁美洲与加勒比海地区` = "#E41A1C", `撒哈拉以南非洲地区` = "#377EB8", - `欧洲与中亚地区` = "#4DAF4A", `中东与北非地区` = "#984EA3", - `东亚与太平洋地区` = "#FF7F00", `南亚` = "#FFFF33", `北美` = "#A65628" - )) + - scale_size(range = c(2, 12)) + - scale_x_log10( - labels = label_dollar(), minor_breaks = mb, limits = c(100, 110000) - ) + - theme_classic() + - labs(x = "人均 GDP", y = "预期寿命", fill = "区域") -``` - -在已有主题的基础上,还可以进一步细微调整,比如,将图例移动至绘图区域的下方,见 @fig-theme-position 。 - -```{r} -#| label: fig-theme-position -#| fig-cap: "图例置于图形下方" -#| fig-showtext: true -#| fig-width: 6 -#| fig-height: 4.5 - -ggplot(data = gapminder, aes(x = gdpPercap, y = lifeExp)) + - geom_point( - data = function(x) subset(x, year == 2007), - aes(fill = region, size = pop), shape = 21, col = "white", - show.legend = c(fill = TRUE, size = FALSE) - ) + - scale_fill_manual(values = c( - `拉丁美洲与加勒比海地区` = "#E41A1C", `撒哈拉以南非洲地区` = "#377EB8", - `欧洲与中亚地区` = "#4DAF4A", `中东与北非地区` = "#984EA3", - `东亚与太平洋地区` = "#FF7F00", `南亚` = "#FFFF33", `北美` = "#A65628" - )) + - scale_size(range = c(2, 12)) + - scale_x_log10( - labels = label_dollar(), minor_breaks = mb, limits = c(100, 110000) - ) + - theme_classic() + - theme(legend.position = "bottom") + - labs(x = "人均 GDP", y = "预期寿命", fill = "区域") -``` - -或者用户觉得合适的任意位置。 - -```{r} -#| label: fig-theme-custom -#| fig-cap: "微调图例位置" -#| fig-showtext: true -#| fig-width: 6 -#| fig-height: 4.5 - -ggplot(data = gapminder, aes(x = gdpPercap, y = lifeExp)) + - geom_point( - data = function(x) subset(x, year == 2007), - aes(fill = region, size = pop), shape = 21, col = "white", - show.legend = c(fill = TRUE, size = FALSE) - ) + - scale_fill_manual(values = c( - `拉丁美洲与加勒比海地区` = "#E41A1C", `撒哈拉以南非洲地区` = "#377EB8", - `欧洲与中亚地区` = "#4DAF4A", `中东与北非地区` = "#984EA3", - `东亚与太平洋地区` = "#FF7F00", `南亚` = "#FFFF33", `北美` = "#A65628" - )) + - scale_size(range = c(2, 12)) + - scale_x_log10( - labels = label_dollar(), minor_breaks = mb, limits = c(100, 110000) - ) + - theme_classic() + - theme(legend.position = "inside", legend.position.inside = c(0.875, 0.3)) + - labs(x = "人均 GDP", y = "预期寿命", fill = "区域") -``` - -或者更换其它主题,比如 **ggthemes** 包内置极简主题 `theme_tufte()`,它仅保留主刻度线,更加凸显数据。 - -```{r} -#| label: fig-theme-tufte -#| fig-cap: ggthemes 的极简主题 Tufte -#| fig-showtext: true -#| fig-width: 6 -#| fig-height: 4.5 - -library(ggthemes) -ggplot(data = gapminder, aes(x = gdpPercap, y = lifeExp)) + - geom_point( - data = function(x) subset(x, year == 2007), - aes(fill = region, size = pop), - show.legend = c(fill = TRUE, size = FALSE), - shape = 21, col = "white" - ) + - scale_fill_manual(values = c( - `拉丁美洲与加勒比海地区` = "#E41A1C", `撒哈拉以南非洲地区` = "#377EB8", - `欧洲与中亚地区` = "#4DAF4A", `中东与北非地区` = "#984EA3", - `东亚与太平洋地区` = "#FF7F00", `南亚` = "#FFFF33", `北美` = "#A65628" - )) + - scale_size(range = c(2, 12)) + - scale_x_log10( - labels = label_dollar(), minor_breaks = mb, limits = c(100, 110000) - ) + - theme_tufte(base_family = "sans") + - theme( - legend.position = "inside", - legend.position.inside = c(0.875, 0.3), - legend.title = element_text(family = "Noto Sans CJK SC"), - legend.text = element_text(family = "Noto Sans CJK SC"), - axis.title = element_text(family = "Noto Sans CJK SC")) + - labs(x = "人均 GDP", y = "预期寿命", fill = "区域") -``` - -## 注释 {#sec-annotation} - -注释可以是普通文本,数学公式,还可以是图形照片、表情包。注释功能非常强大,但也是非常灵活,往往使用起来颇费功夫,需要结合数据情况,从图形所要传递的信息出发,适当添加。R 语言社区陆续出现一些扩展包,让用户使用起来更方便些。 - -- **ggrepel** [@ggrepel2021] 包可以通过添加一定距离的扰动,可以缓解文本重叠的问题,更多内容见 ()。 -- **ggtext** [@ggtext2020] 包支持以 Markdown 语法添加丰富的文本内容,更多内容见 ()。 -- **string2path** [@string2path2022] 包字体轮廓生成路径,注释文本随路径变化,更多内容见 ()。 -- **ggimage** [@ggimage2022] 包提供图像图层,实现以图片代替散点的效果,图片还可以是表情包,更多内容见 ()。 - -在 @fig-theme-tufte 的基础上,给人口总数大于 2 亿的国家添加文本注释。这可以用 **ggplot2** 包提供的文本图层函数 `geom_text()` 实现,效果如 @fig-text 。 - -```{r} -#| label: fig-text -#| fig-cap: "添加文本注释" -#| fig-showtext: true -#| fig-width: 6 -#| fig-height: 4.5 - -library(ggrepel) -ggplot(data = gapminder, aes(x = gdpPercap, y = lifeExp)) + - geom_point( - data = function(x) subset(x, year == 2007), - aes(fill = region, size = pop), - show.legend = c(fill = TRUE, size = FALSE), - shape = 21, col = "white" - ) + - scale_fill_manual(values = c( - `拉丁美洲与加勒比海地区` = "#E41A1C", `撒哈拉以南非洲地区` = "#377EB8", - `欧洲与中亚地区` = "#4DAF4A", `中东与北非地区` = "#984EA3", - `东亚与太平洋地区` = "#FF7F00", `南亚` = "#FFFF33", `北美` = "#A65628" - )) + - scale_x_log10( - labels = label_dollar(), minor_breaks = mb, limits = c(100, 110000) - ) + - geom_text( - data = function(x) subset(x, year == 2007 & pop >= 20 * 10^7), - aes(label = country), show.legend = FALSE - ) + - scale_size(range = c(2, 12)) + - theme_tufte(base_family = "sans") + - theme( - legend.position = "inside", - legend.position.inside = c(0.9, 0.3), - legend.title = element_text(family = "Noto Sans CJK SC"), - legend.text = element_text(family = "Noto Sans CJK SC"), - axis.title = element_text(family = "Noto Sans CJK SC")) + - labs(x = "人均 GDP", y = "预期寿命", fill = "区域") -``` - -当需要给许多点添加文本注释时,就难以避免地遇到注释文本重叠的问题。比如给人口总数大于 5000 万的国家添加文本注释,此时,适合使用 **ggrepel** 包,调用函数 `geom_text_repel()` --- 这是一个新的文本图层,通过添加适当的位移缓解文本重叠问题。 - -```{r} -#| label: fig-text-ggrepel -#| fig-cap: "缓解文本注释相互覆盖的问题" -#| fig-showtext: true -#| fig-width: 6 -#| fig-height: 4.5 - -library(ggrepel) -ggplot(data = gapminder, aes(x = gdpPercap, y = lifeExp)) + - geom_point(data = function(x) subset(x, year == 2007), - aes(fill = region, size = pop), - show.legend = c(fill = TRUE, size = FALSE), - shape = 21, col = "white" - ) + - scale_fill_manual(values = c( - `拉丁美洲与加勒比海地区` = "#E41A1C", `撒哈拉以南非洲地区` = "#377EB8", - `欧洲与中亚地区` = "#4DAF4A", `中东与北非地区` = "#984EA3", - `东亚与太平洋地区` = "#FF7F00", `南亚` = "#FFFF33", `北美` = "#A65628" - )) + - scale_x_log10( - labels = label_dollar(), minor_breaks = mb, limits = c(100, 110000) - ) + - geom_text_repel( - data = function(x) subset(x, year == 2007 & pop >= 5 * 10^7), - aes(label = country), size = 3, max.overlaps = 50, - segment.colour = "gray", seed = 2022, show.legend = FALSE - ) + - scale_size(range = c(2, 12)) + - theme_tufte(base_family = "sans") + - theme( - legend.position = "inside", - legend.position.inside = c(0.9, 0.3), - legend.title = element_text(family = "Noto Sans CJK SC"), - legend.text = element_text(family = "Noto Sans CJK SC"), - axis.title = element_text(family = "Noto Sans CJK SC")) + - labs(x = "人均 GDP", y = "预期寿命", fill = "区域") -``` - -## 分面 {#sec-facet} - -**ggplot2** 包有两个函数 `facet_wrap()` 和 `facet_grid()` 都可以用来实现分面操作,分面的目的是将数据切分,一块一块地展示。下面在 @fig-theme-tufte 的基础上,按收入水平变量分面,即将各个国家或地区按收入水平分开,效果如 @fig-facet-wrap 所示。`facet_grid()` 与 `facet_wrap()` 的效果是类似的,就不再赘述了。 - -```{r} -#| label: fig-facet-wrap -#| fig-cap: "按收入水平变量分面" -#| fig-showtext: true -#| fig-width: 7 -#| fig-height: 5 - -ggplot(data = gapminder, aes(x = gdpPercap, y = lifeExp)) + - geom_point(data = function(x) subset(x, year == 2007), - aes(fill = region, size = pop), - show.legend = c(fill = TRUE, size = FALSE), - shape = 21, col = "white" - ) + - scale_fill_manual(values = c( - `拉丁美洲与加勒比海地区` = "#E41A1C", `撒哈拉以南非洲地区` = "#377EB8", - `欧洲与中亚地区` = "#4DAF4A", `中东与北非地区` = "#984EA3", - `东亚与太平洋地区` = "#FF7F00", `南亚` = "#FFFF33", `北美` = "#A65628" - )) + - scale_size(range = c(2, 12)) + - scale_x_log10(labels = label_log(), limits = c(100, 110000)) + - facet_wrap(facets = ~income_level, ncol = 2) + - theme_classic() + - labs(x = "人均 GDP", y = "预期寿命", fill = "区域") -``` - -在函数 `facet_wrap()` 内设置不同的参数值,会有不同的排列效果。设置 `ncol = 3`,意味着排成 3 列,而分类变量 continent 总共有 5 种不同的类别,因此将会是 3 列 2 行的布局,效果如下 @fig-facet-ncol 。 - -```{r} -#| label: fig-facet-ncol -#| fig-cap: "按区域变量分面" -#| fig-showtext: true -#| fig-width: 7 -#| fig-height: 6 - -ggplot(data = gapminder, aes(x = gdpPercap, y = lifeExp)) + - geom_point(data = function(x) subset(x, year == 2007), - aes(fill = region, size = pop), - show.legend = c(fill = TRUE, size = FALSE), - shape = 21, col = "white" - ) + - scale_fill_manual(values = c( - `拉丁美洲与加勒比海地区` = "#E41A1C", `撒哈拉以南非洲地区` = "#377EB8", - `欧洲与中亚地区` = "#4DAF4A", `中东与北非地区` = "#984EA3", - `东亚与太平洋地区` = "#FF7F00", `南亚` = "#FFFF33", `北美` = "#A65628" - )) + - scale_size(range = c(2, 12)) + - scale_x_log10(labels = label_log(), limits = c(100, 110000)) + - facet_wrap(facets = ~income_level, ncol = 3) + - theme_classic() + - theme(legend.position = "inside", legend.position.inside = c(0.9, 0.2)) + - labs(x = "人均 GDP", y = "预期寿命", fill = "区域") -``` - -## 动画 {#sec-animate} - -从 1991 年至 2020 年,gapminder 数据集一共是 30 年的数据。根据 2007 年的数据绘制了 @fig-animate ,每年的数据绘制一幅图像,30 年总共可获得 30 帧图像,再以每秒播放 6 帧图像的速度将 30 帧图像合成 GIF 动画。因此,设置这个动画总共 30 帧,每秒播放的图像数为 6。 - -```{r} -options(gganimate.nframes = 30, gganimate.fps = 6) -``` - -**gganimate** 包提供一套代码风格类似 **ggplot2** 包的动态图形语法,可以非常顺滑地与之连接。在了解了 ggplot2 绘制图形的过程后,用 **gganimate** 包制作动画是非常容易的。**gganimate** 包会调用 **gifski** () 包来合成动画,因此,除了安装 **gganimate** 包,还需要安装 **gifski** 包。接着,在已有的 **ggplot2** 绘图代码基础上,再追加一个转场图层函数 `transition_time()`,这里是按年逐帧展示图像,因此,其转场的时间变量为 gapminder 数据集中的变量 `year`。 - -```{r} -#| label: fig-animate -#| fig-cap: 制作动画 -#| fig-width: 7 -#| fig-height: 5 -#| fig-show: "animate" -#| dev: "ragg_png" - -library(gganimate) -ggplot(data = gapminder, aes(x = gdpPercap, y = lifeExp)) + - geom_point(aes(fill = region, size = pop), - show.legend = c(fill = TRUE, size = FALSE), - alpha = 0.65, shape = 21, col = "white" - ) + - scale_fill_manual(values = c( - `拉丁美洲与加勒比海地区` = "#E41A1C", `撒哈拉以南非洲地区` = "#377EB8", - `欧洲与中亚地区` = "#4DAF4A", `中东与北非地区` = "#984EA3", - `东亚与太平洋地区` = "#FF7F00", `南亚` = "#FFFF33", `北美` = "#A65628" - )) + - scale_size(range = c(2, 12), labels = label_number(scale_cut = cut_short_scale())) + - scale_x_log10(labels = label_log(), limits = c(10, 130000)) + - facet_wrap(facets = ~income_level) + - theme_classic() + - labs( - title = "{frame_time} 年", x = "人均 GDP", - y = "预期寿命", size = "人口总数", fill = "区域" - ) + - transition_time(time = year) -``` - -## 组合 {#sec-combine} - -将多幅小图组合起来构成一幅大图也是常见的需求,常见于出版级、产品级的作品中。组合涉及到布局,布局涉及到层次。有的组合图是从不同角度呈现数据,有的组合图是从传递信息的主次出发,等等。**patchwork** 包是非常流行的一个基于 **ggplot2** 的用于图形组合的 R 包,下面基于 faithful 数据展示绘制组合图形的过程。 - -首先根据喷发时间将 faithful 数据分成两组。 - -```{r} -# 根据喷发时间将数据分成两组 -faithful <- transform(faithful, group = ifelse(eruptions > 3, "A", "B")) -``` - -绘制分组散点图,叠加二维核密度曲线。 - -```{r} -# 绘制分组散点图 -scatterplot <- ggplot(faithful, aes(eruptions, waiting, color = group)) + - geom_point() + - geom_density_2d() + - theme_classic() + - theme(axis.text = element_blank(), axis.title = element_blank()) -``` - -将上图中的图例单独抽取出来,作为一个子图。 - -```{r} -# https://stackoverflow.com/questions/46079033/ -# Extract legend from ggplot object -extract_legend <- function(gg) { - grobs <- ggplot_gtable(ggplot_build(gg)) - foo <- which(sapply(grobs$grobs, function(x) x$name) == "guide-box") - grobs$grobs[[foo]] -} -legend <- extract_legend(scatterplot) -``` - -获得图例后,原图中不需要图例了。 - -```{r} -scatterplot <- scatterplot + theme(legend.position = "none") -``` - -准备两个箱线图分别描述 faithful 数据集中的等待时间 waiting 和喷发时间 eruptions 。 - -```{r} -boxplot_left <- ggplot(faithful, aes(group, waiting, fill = group)) + - geom_boxplot() + - theme_classic() + - theme( - legend.position = "none", axis.ticks.x = element_blank(), - axis.text.x = element_blank(), axis.title.x = element_blank() - ) - -boxplot_bottom <- ggplot(faithful, aes(group, eruptions, fill = group)) + - geom_boxplot() + - theme_classic() + - theme( - legend.position = "none", axis.ticks.y = element_blank(), - axis.text.y = element_blank(), axis.title.y = element_blank() - ) + - coord_flip() -``` - -加载 **patchwork** 包,使用函数 `wrap_plots()` 组合 `boxplot_left` 、`scatterplot` 、`legend` 和 `boxplot_bottom` 四个子图,最终效果见下图。 - -```{r} -#| label: fig-patchwork -#| fig-width: 6 -#| fig-height: 5 -#| fig-showtext: true -#| fig-cap: patchwork 组合多幅子图 - -library(patchwork) -top <- wrap_plots(boxplot_left, scatterplot, ncol = 2, widths = c(0.2, 0.8)) -bottom <- wrap_plots(legend, boxplot_bottom, ncol = 2, widths = c(0.22, 0.8)) -final <- wrap_plots(top, bottom, nrow = 2, heights = c(0.8, 0.2)) -final -``` - -主图是占据着最大篇幅的叠加二维密度曲线的散点图,展示数据的二维分布,两个箱线图辅助展示等待时间 waiting 和喷发时间 eruptions 的分布,而左下角的图例是次要的说明。 - -## 艺术 {#sec-arts} - -[Georgios Karamanis](https://georgemsavva.github.io/creativecoding/) 基于 R 语言和扩展包 **ggforce** 制作了一系列生成艺术(Generative Arts)作品。下图是 **ggforce** 包的 4 个图层函数 `geom_regon()`、 `geom_spiro()`、 `geom_diagonal()` 和 `geom_spoke()` 分别生成的四幅图片。 - -```{r} -#| label: fig-arts -#| fig-width: 4 -#| fig-height: 4 -#| fig-cap: R 语言与生成艺术 -#| fig-subcap: -#| - 函数 `geom_regon()` -#| - 函数 `geom_spiro()` -#| - 函数 `geom_diagonal()` -#| - 函数 `geom_spoke()` -#| fig-showtext: true -#| layout-ncol: 2 -#| layout-nrow: 2 - -library(ggforce) -s <- 900 -ggplot() + - geom_regon(aes( - x0 = cos((1:s) / 57), y0 = sin((1:s) / 57), - sides = 6, r = cos((1:s) / 24), - angle = cos((1:s) / 23), color = 1:s %% 15 - ), - linewidth = 0.2, fill = NA, linetype = "twodash" - ) + - scale_color_viridis_c(option = 15, guide = "none") + - coord_fixed() + - theme_void() - -r <- seq(1, 11, 0.1) -ggplot() + - geom_spiro(aes(r = r, R = r * 20, d = r^2, outer = T, color = r %% 10), linewidth = 3) + - scale_color_viridis_c(option = "turbo") + - coord_fixed() + - theme_void() + - theme(legend.position = "none") - -s <- 1200 -ggplot() + - geom_diagonal(aes( - x = cos(seq(0, pi, length.out = s)), - y = sin(seq(0, pi, length.out = s)), - xend = cos(seq(0, 360 * pi, length.out = s)), - yend = sin(seq(0, 360 * pi, length.out = s)) - ), - linewidth = 0.1, strength = 1 - ) + - coord_fixed() + - theme_void() - -e <- 1e-3 -s <- 1e4 -t <- pi / 2 * cumsum(seq(e, -e, length.out = s))^3 -ggplot() + - geom_spoke(aes( - x = cumsum(cos(t)), y = cumsum(sin(t)), - angle = t, color = t, radius = 1:s %% 500 - ), alpha = 0.5) + - scale_color_distiller(palette = 15, guide = "none") + - coord_fixed() + - theme_void() -``` - -需要充满想象,或借助数学、物理方程,或借助算法、数据生成。好看,但没什么用的生成艺术作品。 - -- -- -- -- -- diff --git a/visualization-graphics.qmd b/visualization-graphics.qmd deleted file mode 100644 index b7d69a16..00000000 --- a/visualization-graphics.qmd +++ /dev/null @@ -1,685 +0,0 @@ -# graphics 入门 {#sec-basic-graphics} - -```{r} -#| echo: false - -source("_common.R") -``` - -不是把每个绘图函数都挨个讲一遍,也不是把它们统统归纳总结,而是比较深入地介绍一、两种图形,一、两个例子,重点阐述 Base R 的绘图特点,使用图形时,注意图形本身的作用,最终,希望读者能够达到举一反三的效果。 - -基础绘图系统。相比于 **ggplot2** 和 **lattice**,**graphics** 制作示意图是优势。 - -## 绘图基础 {#sec-graphics-elements} - -利用点、线等基础元素从零开始绘图。 - -### `plot()` {#sec-elements-plot} - -本节将主要基于鸢尾花数据集介绍 R 语言基础绘图系统,该数据集最早来自埃德加·安德森,后来,被罗纳德·费希尔在介绍判别分析的论文中用到,从而,流行于机器学习社区。鸢尾花是非常漂亮的一种花,在统计和机器学习社区家喻户晓,更别提在植物界的名声。其实,远不止于此,在绘画艺术界也是如雷贯耳,印象派大师文森特·梵高画了一系列鸢尾花作品。万紫千红,但能入画的不多,故而,鸢尾花更显高雅。在生命最后的一段日子里,梵高受精神病折磨,在法国普罗旺斯的圣·雷米医院里,唯有盛开的鸢尾花陪着他,最著名的《星月夜》就是在这时候创作出来的。下面先让我们一睹鸢尾花芳容,图片来自维基百科鸢尾花词条。 - -::: {#fig-iris layout-ncol="3" layout="[30,40,30]" layout-valign="bottom"} -![versicolor 杂色鸢尾](images/iris-versicolor.jpeg){#fig-iris-versicolor width="70%"} - -![setosa 山鸢尾](images/iris-setosa.jpeg){#fig-iris-setosa width="80%"} - -![virginica 弗吉尼亚鸢尾](images/iris-virginica.jpeg){#fig-iris-virginica width="70%"} - -三种鸢尾花 -::: - -鸢尾花数据集已经打包在 R 软件中,而且默认已经加载到命名空间,下面用函数 `summary()` 查看其概况。 - -```{r} -summary(iris) -``` - -函数 `plot()` 采用公式语法可以快速作图。 - -```{r} -#| label: fig-iris-plot -#| fig-cap: 快速作图函数 `plot()` -#| fig-width: 4 -#| fig-height: 4 -#| fig-showtext: true -#| par: true -#| fig-subcap: -#| - 公式语法绘制散点图 -#| - 带背景参考线的散点图 -#| layout-ncol: 2 - -plot(Sepal.Length ~ Sepal.Width, data = iris) -plot(iris$Sepal.Width, iris$Sepal.Length, panel.first = grid()) -``` - -函数 `plot()` 是一个泛型函数,传递不同类型的参数值会调用不同的绘图方法,而不同的绘图方法的参数是不同的。当采用公式语法绘图时,会自动调用函数 `plot.formula()` ,此时,参数 `panel.first` 就不起作用。当不使用公式语法时,会调用函数 `plot.default()` ,此时,参数 `panel.first` 就起作用,利用该参数可以添加背景参考线。 - -### 标签 {#sec-elements-label} - -函数 `plot()` 的参数 `xlab` 、`ylab` 和 `main` 可以分别设置坐标轴横、纵标签和图主标题。 - -```{r} -#| label: fig-iris-label -#| fig-cap: 标签 -#| fig-width: 5 -#| fig-height: 5 -#| fig-showtext: true - -plot( - Sepal.Length ~ Sepal.Width, data = iris, - xlab = "Sepal Width", ylab = "Sepal Length", - main = "Edgar Anderson's Iris Data" -) -``` - -### 字体 {#sec-elements-fonts} - -作图函数 `plot()` 和 `title()` 都有参数 `family` ,设置该参数可以调整图形中的字体。下 @fig-iris-fonts 的横纵坐标轴标签和图标题设为宋体,坐标轴刻度标签设为无衬线字体。 - -```{r} -#| label: fig-iris-fonts -#| fig-cap: 字体 -#| fig-width: 5 -#| fig-height: 5 -#| fig-showtext: true - -plot(Sepal.Length ~ Sepal.Width, data = iris, ann = FALSE, family = "sans") -title( - xlab = "萼片宽度", ylab = "萼片长度", - main = "埃德加·安德森的鸢尾花数据", family = "Noto Serif CJK SC" -) -``` - -### 分组 {#sec-elements-group} - -分组有两种方式,其一按照数据中的分类变量分组,其二按照一定的规则分组。而图形表达的方式可以借助颜色或图形元素的样式。 - -函数 `plot()` 的参数 `col` 和 `pch` 都可以用来分组,前者通过颜色,后者通过点的类型。简单起见,将数据集 `iris` 中的 `Species` 列传递给参数 `col` ,实现不同种类的鸢尾花配以不同的颜色。 - -```{r} -#| label: fig-iris-group1 -#| fig-cap: 分组 -#| fig-width: 4 -#| fig-height: 4 -#| fig-showtext: true -#| par: true - -plot(Sepal.Length ~ Sepal.Width, data = iris, col = Species, pch = 16) -``` - -下面采用一个简单规则将数据分成两组,将鸢尾花中 setosa 山毛榉类型且 Sepal.Length 萼片长度大于 5 厘米的分成一组,以红色填充散点代表这部分数据,与余下的散点形成对比,达到区分的目的。 - -```{r} -#| label: fig-iris-group2 -#| fig-cap: 分组 -#| fig-width: 4 -#| fig-height: 4 -#| fig-showtext: true -#| par: true - -plot(Sepal.Length ~ Sepal.Width, data = iris) -points(Sepal.Length ~ Sepal.Width, data = iris, - col = "#EA4335", pch = 16, - subset = Species == "setosa" & Sepal.Length > 5 -) -``` - -### 配色 {#sec-elements-color} - -经过探查,知道数据集 `iris` 中的 `Species` 列有三种取值。调用函数 `palette()` 设置一个超过 3 种颜色的调色板可以实现自定义配色。首先来看看当前调色板的颜色。 - -```{r} -palette() -``` - -一共是 8 种颜色,效果预览见 @fig-graphics-palette 。 - -```{r} -#| label: fig-graphics-palette -#| fig-width: 3 -#| fig-height: 3 -#| fig-cap: 默认调色板 -#| fig-showtext: true -#| echo: false - -scales::show_col(colours = palette()) -``` - -设置新的调色板也是用函数 `palette()` ,参数 `value` 设置新的颜色值向量,下面依次是红、蓝、绿、黄四种颜色。 - -```{r} -palette(value = c("#EA4335", "#4285f4", "#34A853", "#FBBC05")) -``` - -函数 `plot()` 的调色板默认来自函数 `palette()` ,经过上面的调整,同一行绘图代码出来不同的效果,即 @fig-iris-group1 变成 @fig-iris-color 。 - -```{r} -#| label: fig-iris-color -#| fig-cap: 配色 -#| fig-width: 4 -#| fig-height: 4 -#| fig-showtext: true -#| par: true - -plot(Sepal.Length ~ Sepal.Width, data = iris, col = Species, pch = 16) -``` - -### 注释 {#sec-elements-annotation} - -函数 `text()` 可以在图上任意位置添加文本或公式。下图在位置 (4,6.5) 处添加红色的文字 flower。 - -```{r} -#| label: fig-iris-text -#| fig-cap: 注释 -#| fig-width: 4 -#| fig-height: 4 -#| fig-showtext: true -#| par: true - -plot(Sepal.Length ~ Sepal.Width, data = iris) -text(x = 4, y = 6.5, labels = "flower", col = "#EA4335") -``` - -### 图例 {#sec-elements-legend} - -函数 `plot()` 不会自动添加图例,需要使用函数 `legend()` 添加图例。 - -```{r} -#| label: fig-iris-legend1 -#| fig-cap: 图例 -#| fig-width: 5 -#| fig-height: 4.5 -#| fig-showtext: true -#| par: true - -plot(Sepal.Length ~ Sepal.Width, data = iris, col = Species, pch = 16) -legend(x = "topright", title = "Species", - legend = unique(iris$Species), box.col = NA, bg = NA, - pch = 16, col = c("#EA4335", "#4285f4", "#34A853") -) -``` - -图例放置在绘图区域以外,比如右边空区域。此时,通过点和文本构造图例。 - -```{r} -#| label: fig-iris-legend2 -#| fig-cap: 图例 -#| fig-width: 6 -#| fig-height: 5 -#| fig-showtext: true - -op <- par(mar = c(4, 4, 3, 6)) -plot( - Sepal.Length ~ Sepal.Width, data = iris, - col = Species, pch = 16, main = "Edgar Anderson's Iris Data" -) -text(x = 4.7, y = 6.75, labels = "Species", pos = 4, offset = .5, xpd = T) -points(x = 4.7, y = 6.5, pch = 16, cex = 1, col = "#EA4335", xpd = T) -text(x = 4.7, y = 6.5, labels = "setosa", pos = 4, col = "#EA4335", xpd = T) -points(x = 4.7, y = 6.3, pch = 16, cex = 1, col = "#4285f4", xpd = T) -text(x = 4.7, y = 6.3, labels = "versicolor", pos = 4, col = "#4285f4", xpd = T) -points(x = 4.7, y = 6.1, pch = 16, cex = 1, col = "#34A853", xpd = T) -text(x = 4.7, y = 6.1, labels = "virginica", pos = 4, col = "#34A853", xpd = T) -on.exit(par(op), add = TRUE) -``` - -在函数 `plot()` 内设置较宽的坐标轴范围,获得一个较宽的绘图区域,再用函数 `points()` 添加数据点,最后,使用函数 `legend()` 添加图例。 - -```{r} -#| label: fig-iris-legend3 -#| fig-cap: 图例 -#| fig-width: 5 -#| fig-height: 5 -#| fig-showtext: true - -plot( - x = c(2, 6), y = range(iris$Sepal.Length), type = "n", - xlab = "Sepal Width", ylab = "Sepal Length", - main = "Edgar Anderson's Iris Data" -) -points(Sepal.Length ~ Sepal.Width, - col = Species, pch = 16, data = iris -) -legend(x = "right", title = "Species", - legend = unique(iris$Species), box.col = NA, bg = NA, - pch = 16, col = c("#EA4335", "#4285f4", "#34A853") -) -``` - -### 统计 {#sec-elements-reg} - -添加分组线性回归线。按鸢尾花种类分组,线性回归模型拟合数据,抽取回归系数。首先,使用函数 `split()` 将数据集 iris 按变量 Species 分组拆分,得到一个列表,每个元素都是数据框。接着,调用函数 `lapply()` 将函数 `lm()` 作用到列表的每个元素上,得到一个列表,每个元素都是线性拟合对象。最后,再调函数 `lapply()` 将函数 `coef()` 应用到列表的每个元素上,得到回归模型的系数向量。 - -```{r} -lapply( - lapply( - split(iris, ~Species), lm, - formula = Sepal.Length ~ Sepal.Width - ), - coef -) -``` - -走到绘图这一步,往往是画什么内容比较清楚,分类数量、调色板都确定下来了。大致来说分 6 步:第一步,实现分组线性回归拟合;第二步,绘制分组散点图;第三步,添加分组回归线;第四步,添加图例并调整图例的位置;第五步,设置图形边界等绘图参数;第六步,添加背景网格线。输入线性拟合对象给函数 `abline()` 可以直接绘制回归线,不需要从拟合对象中提取回归系数。调用函数 `par()` 设置图形边界,特别是增加图形右侧边界以容纳图例,再调用函数 `legend()` 要设置 `xpd = TRUE` 以允许图例超出绘图区域。 - -```{r} -#| label: fig-iris-lm -#| fig-cap: 分组线性回归 -#| fig-width: 6 -#| fig-height: 5 -#| fig-showtext: true - -# 分组线性拟合 -iris_lm <- lapply( - split(iris, ~Species), lm, formula = Sepal.Length ~ Sepal.Width -) -# 将分组变量和颜色映射 -cols <- c("setosa" = "#EA4335", "versicolor" = "#4285f4", "virginica" = "#34A853") -# 设置图形边界以容纳标签和图例 -op <- par(mar = c(4, 4, 3, 8)) -# 绘制分组散点图 -plot( - Sepal.Length ~ Sepal.Width, - data = iris, col = Species, pch = 16, - xlab = "Sepal Width", ylab = "Sepal Length", - main = "Edgar Anderson's Iris Data" -) -# 添加背景参考线 -grid() -# 添加回归线 -for (species in c("setosa", "versicolor", "virginica")) { - abline(iris_lm[[species]], col = cols[species], lwd = 2) -} -# 添加图例 -legend( - x = "right", title = "Species", inset = -0.4, xpd = TRUE, - legend = unique(iris$Species), box.col = NA, bg = NA, lty = 1, lwd = 2, - pch = 16, col = c("#EA4335", "#4285f4", "#34A853") -) -# 恢复图形参数设置 -on.exit(par(op), add = TRUE) -``` - -## 绘图进阶 {#sec-graphics-advanced} - -### 组合图形 {#sec-graphics-composite} - -点、线、多边形组合 - -```{r} -#| label: fig-math-annotation -#| fig-cap: 正态总体下两样本均值之差的检验 -#| fig-width: 7 -#| fig-height: 5 -#| fig-showtext: true - -x <- seq(-10, 10, length = 400) -y1 <- dnorm(x) -y2 <- dnorm(x, m = 3) -op <- par(mar = c(5, 4, 2, 1)) -plot(x, y2, - xlim = c(-3, 8), type = "n", - xlab = quote(Z == frac(mu[1] - mu[2], sigma / sqrt(n))), - ylab = "Density" -) -polygon(c(1.96, 1.96, x[240:400], 10), - c(0, dnorm(1.96, m = 3), y2[240:400], 0), - col = "grey80", lty = 0 -) -lines(x, y2) -lines(x, y1) -polygon(c(-1.96, -1.96, x[161:1], -10), - c(0, dnorm(-1.96, m = 0), y1[161:1], 0), - col = "grey30", lty = 0 -) -polygon(c(1.96, 1.96, x[240:400], 10), - c(0, dnorm(1.96, m = 0), y1[240:400], 0), - col = "grey30" -) -legend(x = 4.2, y = .4, - fill = c("grey80", "grey30"), - legend = expression( - P(abs(Z) > 1.96, H[1]) == 0.85, - P(abs(Z) > 1.96, H[0]) == 0.05 - ), bty = "n" -) -text(0, .2, quote(H[0]:~ ~ mu[1] == mu[2])) -text(3, .2, quote(H[1]:~ ~ mu[1] == mu[2] + delta)) -on.exit(par(op), add = TRUE) -``` - -### 多图布局 {#sec-graphics-layout} - -布局函数 `layout()` 和图形参数设置函数 `par()` - -```{r} -#| label: fig-anscombe -#| fig-cap: 数据可视化很重要 -#| fig-width: 6 -#| fig-height: 6 -#| fig-showtext: true - -data(anscombe) -form <- sprintf("y%d ~ x%d", 1:4, 1:4) -fit <- lapply(form, lm, data = anscombe) -op <- par(mfrow = c(2, 2), mgp = c(2, 0.7, 0), - mar = c(3, 3, 1, 1) + 0.1, oma = c(0, 0, 2, 0)) -for (i in 1:4) { - plot(as.formula(form[i]), - data = anscombe, col = "black", - pch = 20, xlim = c(3, 19), ylim = c(3, 13), - xlab = as.expression(substitute(x[i], list(i = i))), - ylab = as.expression(substitute(y[i], list(i = i))), - family = "sans" - ) - abline(fit[[i]], col = "black") - text( - x = 7, y = 12, family = "sans", - labels = bquote(R^2 == .(round(summary(fit[[i]])$r.squared, 3))) - ) -} -mtext("数据集的四重奏", outer = TRUE) -on.exit(par(op), add = TRUE) -``` - -## 图形选择 {#sec-graphics-choose} - -以不同的二维或三维图形可视化同一份多元数据。颜色图、透视图、等值线图和填充等值线图存在某种相似性,又有区别。 - -### 颜色图 {#sec-color-image} - -$$ -f(x,y) = -\begin{cases} -\frac{\sin(\sqrt{x^2 + y^2})}{\sqrt{x^2 + y^2}}, & (x,y) \neq (0,0)\\ -1, & (x,y) = (0,0) -\end{cases} -$$ - -```{r} -y <- x <- seq(from = -8, to = 8, length.out = 51) -z <- outer(x, y, FUN = function(x, y) sin(sqrt(x^2 + y^2)) / sqrt(x^2 + y^2)) -z[26, 26] <- 1 -``` - -将绘图区域划分成网格,每个小网格对应一个颜色值。函数 `image()` 绘制颜色图 - -```{r} -#| label: fig-image -#| fig-cap: 颜色图 -#| fig-width: 4.5 -#| fig-height: 4.5 -#| dev: 'tikz' -#| fig-process: !expr to_png -#| par: true - -image(x = x, y = y, z = z, xlab = "$x$", ylab = "$y$") -``` - -### 透视图 {#sec-graphics-persp} - -函数 `persp()` 绘制透视图 - -```{r} -#| label: fig-persp -#| fig-cap: 透视图 -#| fig-width: 5.5 -#| fig-height: 4 -#| dev: 'tikz' -#| fig-process: !expr to_png - -op <- par(mar = c(0, 1, 2, 1)) -persp( - x = x, y = y, z = z, main = "二维函数的透视图", - theta = 30, phi = 30, expand = 0.5, col = "lightblue", - xlab = "$x$", ylab = "$y$", zlab = "$f(x,y)$" -) -on.exit(par(op), add = TRUE) -``` - -### 等值线图 {#sec-graphics-contour} - -地理上,常用等高线图描述地形,等高线图和等值线图其实是一个意思。函数 `contour()` 绘制等值线图。 - -```{r} -#| label: fig-contour -#| fig-cap: 等值线图 -#| fig-width: 4.5 -#| fig-height: 4.5 -#| dev: 'tikz' -#| fig-process: !expr to_png -#| par: true - -contour(x = x, y = y, z = z, xlab = "$x$", ylab = "$y$") -``` - -### 填充等值线图 {#sec-graphics-filled-contour} - -函数 `filled.contour()` 绘制填充等值线图。 - -```{r} -#| label: fig-filled-contour -#| fig-cap: 填充等值线图 -#| fig-width: 5 -#| fig-height: 4.5 -#| dev: 'tikz' -#| fig-process: !expr to_png - -filled.contour( - x = x, y = y, z = z, asp = 1, - color.palette = hcl.colors, - plot.title = { - title( - main = "二维函数的填充等值线图", - xlab = "$x$", ylab = "$y$" - ) - }, - plot.axes = { - grid(col = "gray") - axis(1, at = 2 * -4:4, labels = 2 * -4:4) - axis(2, at = 2 * -4:4, labels = 2 * -4:4) - points(0, 0, col = "blue", pch = 16) - }, - key.axes = { - axis(4, seq(-0.2, 1, length.out = 9)) - } -) -``` - -## 总结 {#sec-graphics-summary} - -### tinyplot 包 {#sec-graphics-plot2} - -[tinyplot](https://github.com/grantmcdermott/tinyplot) 包扩展 Base R 函数 `plot()` 的功能,在公式语法方面和 lattice 包很接近。另一个值得一提的 R 包是 [**basetheme**](https://github.com/karoliskoncevicius/basetheme) ,用来设置 Base R 绘图主题。 - -```{r} -#| label: fig-tinyplot-iris -#| fig-cap: tinyplot 包绘制分组散点图 -#| fig-width: 6 -#| fig-height: 4 -#| fig-showtext: true -#| par: true - -library(tinyplot) -tinyplot(Sepal.Length ~ Sepal.Width | Species, data = iris, - palette = "Tableau 10", pch = 16) -``` - -或者使用参数 `by` 指定分组变量,效果和上图一样。 - -```{r} -#| eval: false - -with(iris, { - tinyplot(y = Sepal.Length, x = Sepal.Width, by = Species, - palette = "Tableau 10", pch = 16) -}) -``` - -还可以使用参数 `legend` 调整图例的位置,比如放置在绘图区域下方。 - -```{r} -#| label: fig-tinyplot-legend -#| fig-cap: tinyplot 包调整图例位置 -#| fig-width: 5 -#| fig-height: 5 -#| fig-showtext: true - -op <- par(mar = c(5, 4, .5, .5)) -tinyplot(Sepal.Length ~ Sepal.Width | Species, - data = iris, palette = "Tableau 10", pch = 16, - legend = legend("bottom!", title = "Species of iris", bty = "o") -) -on.exit(par(op), add = TRUE) -``` - -还可以绘制其它类型的图形,如分组密度曲线图等。 - -```{r} -#| label: fig-tinyplot-density -#| fig-cap: tinyplot 包绘制密度曲线图 -#| fig-width: 5 -#| fig-height: 5 -#| fig-showtext: true - -with(iris, tinyplot( - density(Sepal.Length), by = Species, - bg = "by", # 分组填充 - grid = TRUE, # 背景网格 - palette = "Tableau 10", - legend = list("topright", bty = "o") # 右上角图例 -)) -``` - -### plot3D 包 {#sec-graphics-plot3D} - -虽然不提倡大量使用三维图形,但如何绘制三维图形却是生生不息的命题,以下仅是 R 语言社区的冰山一角。 - -- **plotrix** [@Lemon2006] 一个坐落于 R 的红灯区的 R 包。基于 Base R 各类绘图函数。 -- **scatterplot3d** [@Uwe2003] 基于 Base R 绘制三维散点图。 -- **misc3d** [@misc3d2008] 绘制三维图形的杂项,支持通过 Base R、 **tcltk** 包和 **rgl** 包渲染图形。 -- **plot3D** [@plot3D2021] 依赖 **misc3d** 包,加强 Base R 在制作三维图形方面的能力。 - -举个比较新颖的一个例子,**plot3D 包**的函数 `image2D()` 绘制二维颜色图,细看又和 `image()` 函数不同,渲染出来的图形有三维的立体感。归根结底,很多时候束缚住自己的不是工具,而是视野和思维。以奥克兰 Maunga Whau 火山地形数据 `volcano` 为例。 - -```{r} -#| label: fig-volcano-plot3d -#| fig-cap: 奥克兰火山地形图 -#| fig-subcap: -#| - 函数 `image2D()` 二维颜色图 -#| - 函数 `persp3D()` 三维透视图 -#| fig-width: 6.25 -#| fig-height: 5 -#| fig-showtext: true -#| warning: false -#| layout-ncol: 1 -#| out-width: 70% - -library(plot3D) -image2D(volcano, - shade = 0.2, rasterImage = TRUE, asp = 0.7, - xlab = "南北方向", ylab = "东西方向", - main = "奥克兰 Maunga Whau 地形图", clab = "高度", - contour = FALSE, col = hcl.colors(100), - colkey = list( - at = 90 + 20 * 0:5, labels = 90 + 20 * 0:5, - length = 1, width = 1 - ) -) -op <- par(mar = c(1, 1.5, 0, 0)) -persp3D( - x = 1:87, y = 1:61, z = volcano, col = hcl.colors(100), - ticktype = "detailed", colkey = FALSE, expand = 1, - phi = 35, theta = 125, bty = "b2", shade = TRUE, - ltheta = 100, lphi = 45, - xlab = "\n南北方向", ylab = "\n东西方向", zlab = "\n高度" -) -on.exit(par(op), add = TRUE) -``` - -值得一提,Python 社区的绘图模块 matplotlib 同样具有强大的绘图能力,三维图形也不在话下。不过,不同的绘图系统所采用的透视法不同,如下图所示。 - -```{r} -#| eval: false -#| echo: false - -# 保存数据 -write.table(volcano, - file = "data/volcano.csv", sep = ",", - row.names = FALSE, col.names = F, quote = F -) -``` - -```{python} -#| label: fig-volcano-plt -#| fig-cap: matplotlib 绘制三维透视图 -#| fig-width: 5.5 -#| fig-height: 5 -#| code-fold: true -#| echo: !expr knitr::is_html_output() - -from matplotlib import cm -from matplotlib.colors import LightSource -import matplotlib.pyplot as plt -import numpy as np -import pandas as pd - -# 设置 PGF 后端渲染图形 -import matplotlib as mpl -mpl.use("pgf") -# XeLaTeX 编译图形 -plt.rcParams.update({ - "text.usetex": True, - "pgf.texsystem": "xelatex", - "pgf.rcfonts": False, # don't setup fonts from rc parameters - "pgf.preamble": "\n".join([ - r"\usepackage[fontset=fandol,UTF8]{ctex}", - ]), -}) -# 读取数据 -volcano = pd.read_csv("data/volcano.csv", header=None) -# DataFrame 转 Array -z = volcano.to_numpy() -# 数据行、列数 -nrows, ncols = z.shape -# 线性序列 -x = np.linspace(1, 87, ncols) -y = np.linspace(1, 61, nrows) -# 类似 R 语言函数 expand.grid() -xv, yv = np.meshgrid(x, y) -# 设置主题 -fig, ax = plt.subplots(subplot_kw=dict(projection="3d")) -# 观察视角 -ax.view_init(azim=30, elev=30) -# 设置坐标轴标签 -ax.set_xlabel(r"南北方向", rotation=45) -ax.set_ylabel(r"东西方向", rotation=-15) -ax.set_zlabel(r"高度", rotation=90) -# 去掉多余的边空 -fig.set_tight_layout(True) -# 光源照射的角度 -ls = LightSource(270, 45) -# 自定义调色板 -rgb = ls.shade(z, cmap=cm.viridis, vert_exag=0.1, blend_mode="soft") -# 三维透视图 -surf = ax.plot_surface( - xv, yv, z, rstride=1, cstride=1, facecolors=rgb, - linewidth=0, antialiased=False, shade=False -) -# 渲染 -plt.show() -``` - -::: content-hidden -``` python -import matplotlib.font_manager as fm -fm.get_font_names() # 查看可供 matplotlib 使用的字体名称 - -from matplotlib import rcParams -rcParams.keys() # 查看可配置的选项 - -import matplotlib.pyplot as plt -plt.savefig('demo.pdf', backend='pgf') # 保存图片 -# https://matplotlib.org/stable/tutorials/text/pgf.html -``` -::: diff --git a/visualization-intermediate.qmd b/visualization-intermediate.qmd deleted file mode 100755 index d645ae15..00000000 --- a/visualization-intermediate.qmd +++ /dev/null @@ -1,1371 +0,0 @@ -# 基础图形 {#sec-intermediate} - -```{r} -#| echo: false - -source("_common.R") -``` - -本章按照图形作用分类介绍各种各样的统计图形,每个小节包含 5-8 个常用的图形,每个图形会结合数据说明其作用、绘制代码。希望借助真实的数据引发读者兴趣,提出问题,探案数据,讲故事,将其应用于其它场景,举一反三。除了数据获取、清理和预处理的工作外,从原始数据出发,还将穿插介绍图形绘制相关的数据操作,比如适当的分组计算、数据重塑等操作。当然,不可能逐行给出代码的说明和使用,因为这会显得非常累赘。探索数据和绘制图形的过程中,会有很多的中间代码,这些也不再展示了,仅给出最终展示图,但会做适当说明。 - -- @sec-visualize-data-trend 探索、展示数据中隐含的趋势信息,具体有折线图、瀑布图、曲线图、曲面图、热力图、日历图、棋盘图和时间线图。 -- @sec-visualize-data-comparisons 以图形展示数据对比,达到更加突出、显著的效果,让差异给人留下印象,具体有柱形图、条形图、点线图(也叫克利夫兰点图)、雷达图和词云图。 -- @sec-visualize-data-proportion 探索、展示数据中隐含的比例信息,以突出重点,具体有简单饼图、环形饼图、扇形饼图、帕累托图、马赛克图和矩阵树图。 - -## 描述趋势 {#sec-visualize-data-trend} - -GNU R 是一个自由的统计计算和统计绘图环境,最初由新西兰奥克兰大学统计系的 Ross Ihaka 和 Robert Gentleman 共同开发。1997 年之后,成立了一个 R Core Team(R 语言核心团队),他们在版本控制系统 [Apache Subversion](https://subversion.apache.org/)上一起协作开发至今。25 年---四分之一个世纪过去了,下面分析他们留下的一份开发日志,了解一段不轻易为人所知的故事。 - -首先,下载 1997 年至今约 25 年的原始代码提交日志数据。下载数据的代码如下,它是一行 Shell 命令,可在 MacOS 或 Ubuntu 等 Linux 系统的终端里运行,借助 Apache Subversion 软件,将提交日志导出为 [XML 格式](https://www.w3.org/standards/xml/core) 的数据文件,保存在目录 `data-raw/` 下,文件名为 `svn_trunk_log_2022.xml`,本书网页版随附。 - -```{bash} -#| eval: false - -svn log --xml --verbose -r 6:83528 \ - https://svn.r-project.org/R/trunk > data-raw/svn_trunk_log_2022.xml -``` - -去掉没什么信息的前5次代码提交记录:初始化仓库,上传原始的 R 软件源码等。 从 Ross Ihaka 在 1997-09-18 提交第 1 次代码改动开始,下载所有的提交日志。截至 2022-12-31,代码最新版本号为 83528,意味着代码仓库已存在 8 万多次提交。 - -下载数据后,借助 [**xml2**](https://github.com/r-lib/xml2/) 包预处理这份 XML 格式数据,提取最重要的信息,谁在什么时间做了什么改动。经过一番操作后,将清洗干净的数据保存到目录 `data/` 下,以 R 软件特有的文件格式保存为 `svn-trunk-log-2022.rds`,同样与书随附。这样下来,原 XML 格式保存的 35 M 文件减少为 1 M 多,极大地减少存储空间,方便后续的数据探索和可视化。下面是这份日志数据最初的两行: - -```{r} -svn_trunk_log <- readRDS(file = "data/svn-trunk-log-2022.rds") -head(svn_trunk_log, 2) -``` - -一共是四个字段,分别是代码提交时记录的版本号 revision,提交代码的人 author,提交代码的时间 stamp 和提交代码时伴随的说明 msg。接下来,带着问题一起探索开源自由的统计软件 R 过去 25 年波澜壮阔的历史! - -### 折线图 {#sec-line} - -```{=html} - -``` -::: callout-tip -不再介绍每个函数、每个参数和每行代码的作用,而是重点阐述折线图的作用,以及如何解读数据,阐述解读的思路和方向,建立起数据分析的思维。将重点放在这些方面,有助于书籍存在的长远意义,又结合了最真实的背景和原始数据,相信对实际工作的帮助会更大。而对于使用到统计方法的函数,则详加介绍,展示背后的实现细节,而不是调用函数做调包侠。 -::: - -折线图的意义是什么?在表达趋势变化,趋势的解读很重要。先来了解一下总体趋势,即过去 25 年里代码提交次数的变化情况。数据集 `svn_trunk_log` 没有年份字段,但时间字段 stamp 隐含了年份信息,因此,新生成一个字段 year 将年份信息从 stamp 提取出来。 - -```{r} -svn_trunk_log <- within(svn_trunk_log, { - # 提取日期、月份、年份、星期、第几周、第几天等时间成分 - year <- as.integer(format(stamp, "%Y")) - date <- format(stamp, format = "%Y-%m-%d", tz = "UTC") - month <- format(stamp, format = "%m", tz = "UTC") - hour <- format(stamp, format = "%H", tz = "UTC") - week <- format(stamp, format = "%U", tz = "UTC") - wday <- format(stamp, format = "%a", tz = "UTC") - nday <- format(stamp, format = "%j", tz = "UTC") -}) -# 代码维护者 ID 和姓名对应 -ctb_map <- c( - "bates" = "Douglas Bates", "deepayan" = "Deepayan Sarkar", - "duncan" = "Duncan Temple Lang", "falcon" = "Seth Falcon", - "guido" = "Guido Masarotto", "hornik" = "Kurt Hornik", - "iacus" = "Stefano M. Iacus", "ihaka" = "Ross Ihaka", - "jmc" = "John Chambers", "kalibera" = "Tomas Kalibera", - "lawrence" = "Michael Lawrence", "leisch" = "Friedrich Leisch", - "ligges" = "Uwe Ligges", "luke" = "Luke Tierney", - "lyndon" = "Others", "maechler" = "Martin Maechler", - "mike" = "Others", "morgan" = "Martin Morgan", - "murdoch" = "Duncan Murdoch", "murrell" = "Paul Murrell", - "pd" = "Peter Dalgaard", "plummer" = "Martyn Plummer", - "rgentlem" = "Robert Gentleman", "ripley" = "Brian Ripley", - "smeyer" = "Sebastian Meyer", "system" = "Others", - "tlumley" = "Thomas Lumley", "urbaneks" = "Simon Urbanek" -) -svn_trunk_log$author <- ctb_map[svn_trunk_log$author] -``` - -接着,调用分组聚合函数 `aggregate()` 统计各年的代码提交量。 - -```{r} -trunk_year <- aggregate(data = svn_trunk_log, revision ~ year, FUN = length) -``` - -然后,将数据集 trunk_year 以折线图展示,如 @fig-trunk-year-line 所示。 - -```{r} -#| label: fig-trunk-year-line -#| fig-cap: "过去 25 年代码提交次数的变化情况" -#| fig-showtext: true - -library(ggplot2) -ggplot(data = trunk_year, aes(x = year, y = revision)) + - geom_point() + - geom_line() + - theme_classic() + - theme(panel.grid.major.y = element_line(colour = "gray90")) + - labs(x = "年份", y = "提交量") -``` - -为什么呈现这样的变化趋势?我最初想到的是先逐步增加,然后下降一会儿,再趋于平稳。这比较符合软件从快速迭代开发期,过渡到成熟稳定期的生命周期。接着,从小时趋势图观察代码提交量的变化,发现有高峰有低谷,上午高峰,晚上低峰,但也并不是所有年份都一致,这是因为开发者来自世界各地,位于不同的时区。 - -```{r} -#| label: fig-trunk-hour-line -#| fig-cap: "提交代码的时段分布" -#| fig-showtext: true -#| fig-width: 7 -#| fig-height: 5 - -aggregate(data = svn_trunk_log, revision ~ year + hour, length) |> - ggplot(aes(x = hour, y = revision, group = year)) + - geom_line() + - geom_line(data = function(x) subset(x, year < 2006), - aes(color = as.character(year))) + - theme_classic() + - labs(x = "时段", y = "提交量", color = "年份") -``` - -最后,观察代码提交量的月趋势图,12月和次年1月、7-8 月份提交量迎来小高峰,应该是教授们放寒暑假。 - -```{r} -#| label: fig-trunk-month-line -#| fig-cap: "提交代码的月份分布" -#| fig-showtext: true -#| fig-width: 7 -#| fig-height: 5 - -aggregate(data = svn_trunk_log, revision ~ year + month, length) |> - transform(date = as.Date(paste(year, month, "01", sep = "-"))) |> - ggplot(aes(x = date, y = revision)) + - geom_point(aes(color = factor(year)), show.legend = F, size = 0.75) + - geom_line(aes(color = factor(year)), show.legend = F) + - scale_x_date(date_minor_breaks = "1 year") + - theme_classic() + - theme(panel.grid.minor.x = element_line()) + - labs(x = "时间(月粒度)", y = "提交量") -``` - -### 瀑布图 {#sec-waterfall} - -相比于折线图,瀑布图将变化趋势和增减量都展示了,如 @fig-waterfall 所示,每年的提交量就好像瀑布上的水,图中每一段水柱表示当期相对于上一期的增减量。瀑布图是用矩形图层 `geom_rect()` 构造的,数据点作为矩形对角点,对撞型的颜色表示增减。 - -```{r} -#| label: fig-waterfall -#| fig-cap: "25 年代码逐年提交量的变化趋势" -#| fig-showtext: true - -trunk_year <- trunk_year[order(trunk_year$year), ] - -trunk_year_tmp <- data.frame( - xmin = trunk_year$year[-length(trunk_year$year)], - ymin = trunk_year$revision[-length(trunk_year$revision)], - xmax = trunk_year$year[-1], - ymax = trunk_year$revision[-1], - fill = trunk_year$revision[-1] - trunk_year$revision[-length(trunk_year$revision)] > 0 -) - -ggplot() + - geom_rect( - data = trunk_year_tmp, - aes(xmin = xmin, ymin = ymin, xmax = xmax, ymax = ymax, fill = fill -), - show.legend = FALSE - ) + - geom_point( - data = trunk_year, aes(x = year, y = revision), size = 0.75 - ) + - scale_fill_brewer(palette = "Set2") + - theme_classic() + - theme(panel.grid.major.y = element_line(colour = "gray90")) + - labs(x = "年份", y = "提交量") -``` - -**ggTimeSeries** 包 [@ggTimeSeries2022] () 提供统计图层 `stat_waterfall()` 实现类似的瀑布图,如 @fig-waterfall-ggTimeSeries 所示。 - -```{r} -#| label: fig-waterfall-ggTimeSeries -#| fig-cap: "矩形图层构造瀑布图" -#| fig-showtext: true - -library(ggTimeSeries) -ggplot(data = trunk_year, aes(x = year, y = revision)) + - stat_waterfall() + - scale_fill_brewer(palette = "Set2") + - theme_classic() + - theme(panel.grid.major.y = element_line(colour = "gray90")) + - labs(x = "年份", y = "提交量") -``` - -### 曲线图 {#sec-smooth} - -```{=html} - -``` -将散点以线段逐个连接起来,形成折线图,刻画原始的变化,而曲线图的目标是刻画潜在趋势。有两种画法,其一从代数的角度出发,做插值平滑,在相邻两点之间以一条平滑的曲线连接起来;其二从统计的角度出发,做趋势拟合,通过线性或非线性回归,获得变化趋势,以图呈现,使得散点之中隐藏的趋势更加清晰。 - -**ggplot2** [@Hadley2016] 包提供函数 `geom_smooth()` 拟合散点图中隐含的趋势,通过查看函数 `geom_smooth()` 的帮助文档,可以了解其内部调用的统计方法。默认情况下,采用局部多项式回归拟合方法,内部调用了函数 `loess()` 来拟合趋势,如 @fig-trunk-year-smooth 所示。 - -```{r} -#| label: fig-trunk-year-smooth -#| fig-cap: "过去 25 年代码提交次数的变化情况" -#| fig-showtext: true - -ggplot(data = trunk_year, aes(x = year, y = revision)) + - geom_point() + - geom_smooth(data = subset(trunk_year, year != 1997)) + - theme_classic() + - theme(panel.grid.major.y = element_line(colour = "gray90")) + - labs(x = "年份", y = "提交量") -``` - -类似大家熟悉的线性回归拟合函数 `lm()`,函数 `loess()` 也是基于类似的使用语法。下面继续以此数据为例,了解该函数的使用,继而了解 ggplot2 绘制平滑曲线图背后的统计方法。1997 年是不完整的,不参与模型参数的估计。 - -```{r} -trunk_year_loess <- loess(revision ~ year, - data = subset(trunk_year, year != 1997), - span = 0.75, degree = 2, method = "loess", - family = "symmetric", - control = loess.control(surface = "direct", iterations = 4) -) -``` - -下面通过设定函数 `geom_smooth()` 的参数,可以达到一样的效果,见下 @fig-trunk-year-loess - -```{r} -#| label: fig-trunk-year-loess -#| fig-cap: "过去 25 年代码提交次数的变化情况" -#| fig-showtext: true - -ggplot(data = trunk_year, aes(x = year, y = revision)) + - geom_point() + - geom_smooth(method = "loess", formula = "y~x", - method.args = list( - span = 0.75, degree = 2, family = "symmetric", - control = loess.control(surface = "direct", iterations = 4) - ), data = subset(trunk_year, year != 1997)) + - theme_classic() + - theme(panel.grid.major.y = element_line(colour = "gray90")) + - labs(x = "年份", y = "提交量") -``` - -`method = "loess"` 意味着调用了一种非参数的回归方法,即局部估计散点平滑 (locally estimated scatterplot smoothing),另一个与之类似的回归方法是局部加权散点平滑 (locally weighted scatterplot smoothing),简称 lowess 。1991 年 [Jerome Friedman](https://statweb.stanford.edu/~jhf/) 提出多元适应性回归样条(**M**ultivariate **A**daptive **R**egression **S**plines),R 语言社区对应功能的扩展包是 **earth** 。 - -除了 `method = "loess"`,函数 `geom_smooth()` 支持的统计方法还有很多,比如非线性回归拟合 `nls()` - -```{r} -trunk_year_nls <- nls(revision ~ a * (year - 1996)^2 + b, - data = subset(trunk_year, year != 1997), - start = list(a = -0.1, b = 1000) -) -``` - -采用一元二次非线性回归拟合方法,效果如 @fig-trunk-year-nls 所示。 - -```{r} -#| label: fig-trunk-year-nls -#| fig-cap: "过去 25 年代码提交次数的变化情况" -#| fig-showtext: true - -ggplot(data = trunk_year, aes(x = year, y = revision)) + - geom_point() + - geom_smooth( - method = "nls", - formula = "y ~ a * (x - 1996)^2 + b", - method.args = list( - start = list(a = -0.1, b = 1000) - ), se = FALSE, - data = subset(trunk_year, year != 1997), - ) + - theme_classic() + - theme(panel.grid.major.y = element_line(colour = "gray90")) + - labs(x = "年份", y = "提交量") -``` - -::: callout-caution -在函数 `geom_smooth()` 内调用非线性回归拟合方法时,暂不支持提供置信区间。 -::: - -即便在不清楚统计原理的情况下,也不难看出 @fig-trunk-year-loess 和 @fig-trunk-year-nls 的差异,局部多项式回归捕捉到了更多的信息,特别是起步阶段的上升趋势,以及 2000-2005 年的高峰特点。 - -```{r} -summary(trunk_year_loess) -``` - -```{r} -summary(trunk_year_nls) -``` - -非线性回归模型带有 2 个参数,一共 26 个观察值,因此,自由度为 26 - 2 = 24。 RSE 残差平方和的标准差为 - -```{r} -# 非线性回归的残差平方和的标准差 -sqrt(sum(residuals(trunk_year_nls)^2)/24) -``` - -```{r} -#| eval: false -#| echo: false - -trunk_year_fit <- within(trunk_year, { - nls_fitted = fitted(trunk_year_nls) - loess_fitted = fitted(trunk_year_loess) -}) -``` - -以平滑曲线连接相邻的散点,可以构造一个插值方法给函数 `geom_smooth()`,如下示例基于样条插值函数 `spline()`。样条源于德国宝马工程师,车辆外壳弧线,那些拥有非常漂亮的弧线,越光滑,与空气的摩擦阻力越小,车辆的气动外形更加符合流体力学的要求,加工打磨更加困难,往往价值不菲。美感是相通的,即使不懂车标,通过气动外形,也能识别出车辆的档次。 - -**ggplot2** 包支持的平滑方法有很多,如借助函数 `splinefun()` 构造样条插值获得平滑曲线,调用 **mgcv** 包的函数 `gam()` ,调用 **ggalt** 包的函数 `geom_xspline()` 。 - -```{r} -#| label: fig-trunk-year-xxspline -#| fig-cap: "过去 25 年代码提交次数的变化情况" -#| fig-subcap: -#| - 自定义样条插值 spline -#| - 广义可加模型样条拟合 -#| - 自由度为 3 的正交多项式拟合 -#| fig-showtext: true -#| layout-ncol: 2 -#| fig-width: 4.5 -#| fig-height: 4 - -xxspline <- function(formula, data, ...) { - dat <- model.frame(formula, data) - res <- splinefun(dat[[2]], dat[[1]]) - class(res) <- "xxspline" - res -} - -predict.xxspline <- function(object, newdata, ...) { - object(newdata[[1]]) -} - -ggplot(data = trunk_year, aes(x = year, y = revision)) + - geom_point() + - geom_smooth( - formula = "y~x", - method = xxspline, se = FALSE, - data = subset(trunk_year, year != 1997) - ) + - theme_classic() + - theme(panel.grid.major.y = element_line(colour = "gray90")) + - labs(x = "年份", y = "提交量") - -ggplot(data = trunk_year, aes(x = year, y = revision)) + - geom_point() + - geom_smooth( - formula = y ~ s(x, k = 12), - method = "gam", se = FALSE, - data = subset(trunk_year, year != 1997) - ) + - theme_classic() + - theme(panel.grid.major.y = element_line(colour = "gray90")) + - labs(x = "年份", y = "提交量") - -ggplot(data = trunk_year, aes(x = year, y = revision)) + - geom_point() + - geom_smooth( - method = "lm", - formula = "y ~ poly((x - 1996), 3)", - se = FALSE, - data = subset(trunk_year, year != 1997), - ) + - theme_classic() + - theme(panel.grid.major.y = element_line(colour = "gray90")) + - labs(x = "年份", y = "提交量") -``` - -数学公式表达的统计模型与 R 语言表达的计算公式的对应关系见下 @tbl-formula ,更多详情见帮助文档 `?formula`。 - -| 数学公式 | R 语言计算公式 | -|:------------------------------|:----------------------------------------| -| $y = \beta_0$ | `y ~ 1` | -| $y = \beta_0 + \beta_1 x_1$ | `y ~ 1 + x1` 或 `y ~ x1` 或 `y ~ x1 + x1^2` | -| $y = \beta_1 x_1$ | `y ~ 0 + x1` 或 `y ~ -1 + x1` | -| $y = \beta_0 + \beta_1 x_1 + \beta_2 x_2$ | `y ~ x1 + x2` | -| $y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_3 x_1 x_2$ | `y ~ x1 * x2` | -| $y = \beta_0 + \beta_1 x_1 x_2$ | `y ~ x1:x2` | -| $y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_3 x_1 x_2$ | `y ~ x1 + x2 + x1:x2` | -| $y = \beta_0 + \sum_{i=1}^{999}\beta_i x_i$ | `y ~ .` | -| $y = \beta_0 + \beta_1 x + \beta_2 x^5$ | `y ~ x + I(x^5)` | -| $y = \beta_0 + \beta_1 x + \beta_2 x^2$ | `y ~ x + I(x^2)` | -| $y = \beta_0 + \beta_1 x + \beta_2 x^2$ | `y ~ poly(x, degree = 2, raw = TRUE)` | - -: 数学公式与 R 语言表示的计算公式 {#tbl-formula} - -### 流线图 {#sec-streamgraph} - -流线图(Stream Graph)是堆积面积图(Stacked Area Graph)的一种变体,适合描述时间序列数据的趋势。**ggplot2** 扩展包 [ggstream](https://github.com/davidsjoberg/ggstream) 可以制作流线图,如下图所示。 - -```{r} -#| label: fig-streamgraph -#| fig-width: 7 -#| fig-height: 6 -#| fig-showtext: true -#| fig-cap: 各开发者的提交量趋势 - -library(ggstream) -trunk_year_author <- aggregate(data = svn_trunk_log, revision ~ year + author, FUN = length) -ggplot(trunk_year_author, aes(x = year, y = revision, fill = author)) + - geom_stream() + - theme_classic() + - theme(legend.position = "bottom") + - labs(x = "年份", y = "提交量", fill = "贡献者") -``` - -### 曲面图 {#sec-wireframe} - -**ggplot2** 包暂不支持绘制三维曲面图,而 **lattice** 包支持,但也是非常有限的支持。**lattice 包**和 **ggplot2** 包都是基于图形语法的,层层叠加就必然会出现覆盖,只有在绘制函数型数据的图像时是合适的,因为覆盖少,即使覆盖也不妨碍趋势的表达。根据不同的使用场景有两个更好的选择,基于 OpenGL 的真三维图形可以用 [rayrender](https://github.com/tylermorganwall/rayrender) 和 [rayshader](https://github.com/tylermorganwall/rayshader) 包绘制,而基于 JavaScripts 的交互式三维图形可以用 [rgl](https://github.com/dmurdoch/rgl) 或 [plotly](https://github.com/plotly/plotly.R) 包绘制。 - -下 @fig-trunk-year-wireframe 是用 **lattice** 包的 `wireframe()` 函数绘制的,这是一个三维曲面透视图,三维图形有时候并不能很好地表达数据,或者数据并不适合用三维图形表示。数据本身并没有那么明显的趋势规律,同样也会体现不出三维图形的表达能力。大部分情况下,我们应当避免使用静态的三维图形,但函数型数据是适合用三维图形来表达的。 - -```{r} -#| label: fig-trunk-year-wireframe -#| fig-cap: "25 年代码提交量变化趋势图" -#| fig-width: 7 -#| fig-height: 6 -#| echo: !expr knitr::is_html_output() -#| fig-showtext: true -#| code-fold: true - -trunk_year_week <- aggregate(data = svn_trunk_log, revision ~ year + week, FUN = length) -library(lattice) -wireframe( - data = trunk_year_week, revision ~ year * as.integer(week), - shade = TRUE, drape = FALSE, - xlab = "年份", - ylab = "第几周", - zlab = list("提交量", rot = 90), - scales = list( - arrows = FALSE, col = "black" - ), - # 减少三维图形的边空 - lattice.options = list( - layout.widths = list( - left.padding = list(x = -.6, units = "inches"), - right.padding = list(x = -1.0, units = "inches") - ), - layout.heights = list( - bottom.padding = list(x = -.8, units = "inches"), - top.padding = list(x = -1.0, units = "inches") - ) - ), - par.settings = list(axis.line = list(col = "transparent")), - screen = list(z = -60, x = -70, y = 0) -) -``` - -每周的代码提交量受影响因素多,不确定性多,波动表现尖锐高频,上图反而对整体趋势的表达不够简洁清晰。按年、月统计提交量平均掉了每日的波动,反而可以体现更大的周期性和趋势性。下面绘制三维柱形图,三维图形天然给人有更加直观的感觉,毕竟立体。**latticeExtra** 包提供三维柱形图图层 `panel.3dbars()`,如 @fig-trunk-year-3dbarplot 所示。 - -```{r} -#| label: fig-trunk-year-3dbarplot -#| fig-cap: "25 年代码提交量变化趋势图" -#| fig-width: 7 -#| fig-height: 6 -#| echo: !expr knitr::is_html_output() -#| fig-showtext: true -#| code-fold: true - -# 按年、月分组统计代码提交量 -trunk_year_month <- aggregate( - data = svn_trunk_log, - revision ~ year + month, FUN = length -) -# 数据转化为矩阵类型 -trunk_year_month_m <- matrix( - data = trunk_year_month[trunk_year_month$year > 1998, "revision"], - ncol = 12, nrow = 24, byrow = FALSE, - dimnames = list( - 1999:2022, # 行 - 1:12 # 列 - ) -) -# 绘制三维柱形图 -cloud(trunk_year_month_m, - panel.3d.cloud = latticeExtra::panel.3dbars, - col.facet = "red", # 柱子的颜色 - col = "gray90", - xbase = 0.5, ybase = 0.5, # 柱子的大小 - scales = list( - arrows = FALSE, col = "black", - # tck 刻度线的长度 - tck = c(0.7, 1.5, 1), - # distance 控制标签到轴的距离 - distance = c(1.2, 0.6, 0.8) - ), - # rot 旋转轴标签 - xlab = list("年份", rot = -45), ylab = list("月份", rot = 45), - zlab = list("提交量", rot = 90), - # 减少三维图形的边空 - lattice.options = list( - layout.widths = list( - left.padding = list(x = -.6, units = "inches"), - right.padding = list(x = -1.0, units = "inches") - ), - layout.heights = list( - bottom.padding = list(x = -.8, units = "inches"), - top.padding = list(x = -1.0, units = "inches") - ) - ), - # 去掉边框 - par.settings = list( - axis.line = list(col = "transparent"), - layout.widths = list(ylab.axis.padding = 0) - ), - screen = list(z = -45, x = -30, y = 0) -) -``` - -### 热力图 {#sec-heatmap} - -@fig-trunk-year-heatmap 提交量变化趋势 - -```{r} -#| label: fig-trunk-year-heatmap -#| fig-cap: "25 年代码提交量变化热力图" -#| fig-width: 7 -#| fig-height: 4 -#| fig-showtext: true - -ggplot(data = trunk_year_week, aes(x = as.integer(week) , y = year, fill = revision)) + - geom_tile(linewidth = 0.4) + - scale_fill_viridis_c(option = "C") + - scale_x_continuous(expand = c(0, 0)) + - scale_y_continuous(expand = c(0, 0)) + - theme_classic() + - labs(x = "第几周", y = "年份", fill = "提交量") -``` - -图层 `scale_x_continuous()` 中设置 `expand = c(0, 0)` 可以去掉数据与 x 轴之间的空隙。 或者添加坐标参考系图层 `coord_cartesian()`,设置参数 `expand = FALSE` 同时去掉横纵轴与数据之间的空隙。 - -```{r} -#| label: fig-trunk-month-heatmap -#| fig-cap: "25 年代码提交量变化热力图" -#| fig-width: 5 -#| fig-height: 4 -#| fig-showtext: true - -aggregate(data = svn_trunk_log, revision ~ year + month, length) |> - ggplot(aes(x = month, y = year, fill = revision)) + - geom_tile(linewidth = 0.4) + - scale_fill_viridis_c(option = "C") + - coord_cartesian(expand = FALSE) + - theme_classic() + - labs(x = "月份", y = "年份", fill = "提交量") -``` - -### 日历图 {#sec-calendar} - -更加直观地展示出节假日、休息工作日、寒暑假,比如描述学生学习规律、需求的季节性变化、周期性变化。 - -```{r} -# 星期、月份缩写 -week.abb <- c("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat") -month.abb <- c( - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" -) -# 按年、星期、第几周聚合统计提交量数据 -svn_trunk_year <- aggregate( - revision ~ year + wday + week, FUN = length, - data = svn_trunk_log, subset = year %in% 2018:2022 -) -# 第几周转为整型数据 -# 周几转为因子型数据 -svn_trunk_year <- within(svn_trunk_year, { - week = as.integer(week) - wday = factor(wday, labels = week.abb) -}) -``` - -```{r} -#| label: fig-calendar -#| fig-cap: "最近 5 年休息和工作日打码活跃度" -#| fig-width: 8 -#| fig-height: 7 -#| fig-showtext: true - -ggplot(data = svn_trunk_year, aes( - x = week, y = wday, fill = cut(revision, breaks = 5 * 0:5) -)) + - geom_tile(color = "white", linewidth = 0.5) + - scale_fill_brewer(palette = "Greens") + - scale_x_continuous( - expand = c(0, 0), breaks = seq(1, 52, length = 12), labels = month.abb - ) + - facet_wrap(~year, ncol = 1) + - theme_minimal() + - labs(x = "月份", y = "星期", fill = "提交量") -``` - -经过了解 svn_trunk_year 2018 - 2022 年每天提交量的范围是 0 次到 21 次,0 次表示当天没有提交代码,SVN 上也不会有日志记录。因此,将提交量划分为 5 档 - -### 棋盘图 {#sec-chess} - -棋盘图一般可以放所有时间节点的聚合信息,格点处为落的子 - -```{r} -#| echo: false -#| label: rversion-raw-data - -rversion <- readRDS(file = "data/rversion-2022.rds") -``` - -该数据集的存储结构很简单,是一个两列的数据框,它的一些属性如下: - -```{r} -str(rversion) -``` - -做一点数据处理,将 date 字段转为日期类型,并从日期中提取年、月信息。 - -```{r} -rversion$date <- as.Date(rversion$date, format = "%Y-%m-%d", tz = "UTC") -rversion$year <- format(rversion$date, "%Y") -rversion$month <- format(rversion$date, "%m") -``` - -统计过去 25 年里每月的发版次数,如图 @fig-rversion-chess - -```{r} -#| label: fig-rversion-chess -#| fig-cap: "25 年 R 软件发版情况" -#| fig-showtext: true -#| fig-width: 6 -#| fig-height: 8 - -aggregate(data = rversion, version ~ year + month, length) |> - ggplot(aes(x = month, y = year)) + - geom_label(aes(label = version, fill = version), - show.legend = F, color = "white") + - scale_fill_viridis_c(option = "D", begin = 0.2, end = 0.8) + - theme_classic() + - theme(panel.grid.major.y = element_line(colour = "gray95")) + - labs(x = "月份", y = "年份") -``` - -### 时间线图 {#sec-timeline} - -时间线图非常适合回顾过去,展望未来,讲故事 - -时间线图展示信息的层次和密度一般由时间跨度决定。时间跨度大时,展示重点节点信息,时间跨度小时,重点和次重点信息都可以放。从更加宏观的视角,厘清发展脉络,比如近两年的 R 软件发版情况。 - -本节用到一个数据集 rversion,记录了历次 R 软件发版时间及版本号,见 @tbl-rversion - -```{r} -#| echo: false -#| label: tbl-rversion -#| tbl-cap: "R 软件发版数据集(部分)" - -knitr::kable(head(rversion), col.names = c("版本号", "发版日期", "发版年份", "发版月份")) -``` - -```{r} -rversion_tl <- within(rversion, { - # 版本号为 x.0.0 为重大版本 big - # 版本号为 x.1.0 x.12.0 x.20.0 为主要版本 major - # 版本号为 x.0.1 为次要版本 minor - status <- ifelse(grepl(pattern = "*\\.0\\.0", x = version), "big", version) - status <- ifelse(grepl(pattern = "*\\.[1-9]{1,2}\\.0$", x = status), "major", status) - status <- ifelse(!status %in% c("big", "major"), "minor", status) -}) -positions <- c(0.5, -0.5, 1.0, -1.0, 1.5, -1.5) -directions <- c(1, -1) -# 位置 -rversion_pos <- data.frame( - # 只要不是同一天发布的版本,方向相对 - date = unique(rversion_tl$date), - position = rep_len(positions, length.out = length(unique(rversion_tl$date))), - direction = rep_len(directions, length.out = length(unique(rversion_tl$date))) -) -# 原始数据上添加方向和位置信息 -rversion_df <- merge(x = rversion_tl, y = rversion_pos, by = "date", all = TRUE) -# 最重要的状态放在最后绘制到图上 -rversion_df <- rversion_df[with(rversion_df, order(date, status)), ] -``` - -选取一小段时间内的发版情况,比如最近的三年 --- 2020 - 2022 年 - -```{r} -# 选取 2020 - 2022 年的数据 -sub_rversion_df<- rversion_df[rversion_df$year %in% 2020:2022, ] -# 月份注释 -month_dat <- data.frame( - date = seq(from = as.Date('2020-01-01'), to = as.Date('2022-12-31'), by = "3 month") -) -month_dat <- within(month_dat, { - month = format(date, "%b") -}) -# 年份注释 -year_dat <- data.frame( - date = seq(from = as.Date('2020-01-01'), to = as.Date('2022-12-31'), by = "1 year") -) -year_dat <- within(year_dat, { - year = format(date, "%Y") -}) -``` - -@fig-rversion-timeline 展示 2020-2022 年 R 软件发版情况 - -```{r} -#| label: fig-rversion-timeline -#| fig-cap: "2020-2022 年 R 软件发版情况" -#| fig-width: 8 -#| fig-height: 4 -#| fig-showtext: true - -ggplot(data = sub_rversion_df) + - geom_segment(aes(x = date, y = 0, xend = date, yend = position)) + - geom_hline(yintercept = 0, color = "black", linewidth = 1) + - geom_label( - aes(x = date, y = position, label = version, color = status), - show.legend = FALSE - ) + - geom_point(aes(x = date, y = 0, color = status), - size = 3, show.legend = FALSE - ) + - geom_text( - data = month_dat, aes(x = date, y = 0, label = month), vjust = 1.5 - ) + - geom_text( - data = year_dat, aes(x = date, y = 0, label = year), vjust = -0.5 - ) + - theme_void() -``` - -图中红色标注的是里程碑式的重大版本,绿色标注的是主要版本,蓝色标注的次要版本,小修小补,小版本更新。 - -当时间跨度非常大时,比如过去 25 年,那就只能放重大版本和主要版本信息了,时间上月份信息就不能用名称简写,而用数字更加合适。而且还得竖着放,同时添加那个版本最有影响力的改动。相比于,棋盘图,这是时间线图的优势。 - -```{r} -#| label: fig-rversion-major -#| fig-cap: "25 年里 R 软件重大及主要版本发布情况" -#| fig-width: 6 -#| fig-height: 8 -#| fig-showtext: true - -sub_rversion_df2 <- rversion_df[rversion_df$status %in% c("big", "major"), ] -ggplot(data = sub_rversion_df2) + - geom_segment(aes(x = 0, y = date, xend = position, yend = date, color = status), - show.legend = F - ) + - geom_vline(xintercept = 0, color = "black", linewidth = 1) + - geom_label( - aes(x = position, y = date, label = version, color = status), - show.legend = FALSE - ) + - geom_point(aes(x = 0, y = date, color = status), size = 3, show.legend = FALSE) + - geom_text( - aes(x = 0, y = as.Date(format(date, "%Y-01-01")), label = year), - hjust = -0.1 - ) + - theme_void() -``` - -在 R 语言诞生的前 5 年里,每年发布 3 个主要版本,这 5 年是 R 软件活跃开发的时期。而 2003-2012 年的这 10 年,基本上每年发布 2 个主要版本。2013-2022 年的这 10 年,基本上每年发布 1 个主要版本。 - -[timevis](https://github.com/daattali/timevis) 包基于 JavaScript 库 [Vis](https://visjs.org/) 的 [vis-timeline](https://github.com/visjs/vis-timeline) 模块,可以 创建交互式的时间线图,支持与 Shiny 应用集成。 - -## 描述对比 {#sec-visualize-data-comparisons} - -数据来自中国国家统计局发布的2021年统计年鉴, - -```{r} -#| label: tbl-china-age-sex -#| tbl-cap: "中国各年龄段的性别比数据(部分)" -#| echo: false - -china_age_sex = readRDS(file = "data/china-age-sex-2020.rds") -knitr::kable(head(china_age_sex)) -``` - -对比的是什么?城市、镇和乡村的性别分布,是否失衡?在哪个年龄段表现很失衡? - -### 柱形图 {#sec-column} - -分年龄段比较城市、镇和乡村的性别比数据 - -```{r} -#| label: fig-column -#| fig-cap: "分年龄段比较城市、镇和乡村的性别比数据" -#| fig-width: 7.5 -#| fig-height: 4.5 -#| fig-showtext: true - -ggplot(data = china_age_sex, aes(x = `年龄`, y = `性别比(女=100)`, fill = `区域`)) + - geom_hline(yintercept = 100, color = "gray", lty = 2, linewidth = 1) + - geom_col(position = "dodge2", width = 0.75) + - theme_bw() -``` - -考虑到数据本身的含义,一般来说,性别比不可能从 0 开始,除非现实中出现了《西游记》里的女儿国。因此,将纵轴的范围,稍加限制,从 性别比为 70 开始,目的是突出城市、镇和乡村的差异。 - -```{r} -#| label: fig-column-better -#| fig-cap: "分年龄段比较城市、镇和乡村的性别比数据" -#| fig-width: 7.5 -#| fig-height: 4.5 -#| fig-showtext: true - -ggplot(data = china_age_sex, aes(x = `年龄`, y = `性别比(女=100)`, fill = `区域`)) + - geom_hline(yintercept = 100, color = "gray", lty = 2, linewidth = 1) + - geom_col(position = "dodge2", width = 0.75) + - coord_cartesian(ylim = c(70, 130)) + - theme_bw() -``` - -### 条形图 {#sec-barchart} - -将柱形图横过来即可得到条形图,横过来的好处主要体现在分类很多的时候,留足空间给年龄分组的分类标签,从左到右,从上往下也十分符合大众的阅读习惯 - -```{r} -#| label: fig-barchart -#| fig-cap: "分年龄段比较城市、镇和乡村的性别比数据" -#| fig-width: 6 -#| fig-height: 5.5 -#| fig-showtext: true - -ggplot(data = china_age_sex, aes(x = `性别比(女=100)`, y = `年龄`, fill = `区域`)) + - geom_vline(xintercept = 100, color = "gray", lty = 2, linewidth = 1) + - geom_col(position = "dodge2", width = 0.75) + - coord_cartesian(xlim = c(70, 130)) + - theme_bw() -``` - -### 点线图 {#sec-cleveland} - -克利夫兰点图 `dotchart()` 在条形图的基础上,省略了条形图的宽度,可以容纳更多的数据点。 - -```{r} -#| label: fig-dotchart -#| fig-cap: "分年龄段比较城市、镇和乡村的性别比数据" -#| fig-width: 5.5 -#| fig-height: 5.5 -#| fig-showtext: true - -ggplot(data = china_age_sex, aes(x = `性别比(女=100)`, y = `年龄`, color = `区域`)) + - geom_vline(xintercept = 100, color = "lightgray", lty = 2, linewidth = 1) + - geom_point() + - theme_bw() -``` - -### 词云图 {#sec-wordcloud} - -[**ggwordcloud**](https://github.com/lepennec/ggwordcloud) 包提供词云图层 `geom_text_wordcloud()` 根据代码提交的说明制作词云图。 - -```{r} -#| label: fig-wordcloud -#| fig-cap: "词云图" -#| fig-width: 7 -#| fig-showtext: true -#| fig-asp: 0.618 -#| fig-dpi: 96 - -library(ggwordcloud) -aggregate(data = svn_trunk_log, revision ~ author, FUN = length) |> - ggplot(aes(label = author, size = revision)) + - geom_text_wordcloud(seed = 2022, grid_size = 10, max_grid_size = 24) + - scale_size_area(max_size = 20) -``` - -词云图也可以是条形图或柱形图的一种替代,词云图不用担心数目多少,而条形图不适合太多的分类情形。 - -```{r} -#| label: fig-trunk-author -#| fig-cap: "开发者提交量排行榜" -#| fig-width: 5 -#| fig-height: 4 -#| fig-showtext: true - -aggregate(data = svn_trunk_log, revision ~ author, FUN = length) |> - subset(subset = revision >= 100) |> - ggplot(aes(x = revision, y = reorder(author, revision))) + - geom_col() + - theme_classic() + - coord_cartesian(expand = FALSE) + - labs(x = "提交量", y = "维护者") -``` - -## 描述占比 {#sec-visualize-data-proportion} - -### 简单饼图 {#sec-naive-pie} - -提交量小于 2000 次的贡献者合并为一类 Others,按贡献者分组统计提交量及其占比,如 @fig-pie 所示。 - -```{r} -#| label: fig-pie -#| fig-cap: "维护者提交量占比" -#| fig-width: 5 -#| fig-height: 4 -#| fig-showtext: true - -aggregate(data = svn_trunk_log, revision ~ author, FUN = length) |> - transform(author2 = ifelse(revision < 2000, "Others", author)) |> - aggregate(revision ~ author2, FUN = sum) |> - transform(label = paste0(round(revision / sum(revision), digits = 4) * 100, "%")) |> - ggplot(aes(x = 1, fill = reorder(author2, revision), y = revision)) + - geom_col(position = "fill", show.legend = FALSE, color = "white") + - scale_y_continuous(labels = scales::label_percent()) + - coord_polar(theta = "y") + - geom_text(aes(x = 1.2, label = author2), - position = position_fill(vjust = 0.5), color = "black" - ) + - geom_text(aes(x = 1.65, label = label), - position = position_fill(vjust = 0.5), color = "black" - ) + - theme_void() + - labs(x = NULL, y = NULL) -``` - -当把提交量小于 1000 次的贡献者合并为 Others,则分类较多,占比小的也有一席之地,饼图上显得十分拥挤。 - -```{r} -#| label: fig-pie-bad -#| fig-cap: "维护者提交量占比" -#| fig-width: 5 -#| fig-height: 4 -#| fig-showtext: true - -aggregate(data = svn_trunk_log, revision ~ author, FUN = length) |> - transform(author2 = ifelse(revision < 1000, "Others", author)) |> - aggregate(revision ~ author2, FUN = sum) |> - transform(label = paste0(round(revision / sum(revision), digits = 4) * 100, "%")) |> - ggplot(aes(x = 1, fill = reorder(author2, revision) , y = revision)) + - geom_col(position = "fill", show.legend = FALSE, color = "white") + - scale_y_continuous(labels = scales::label_percent()) + - coord_polar(theta = "y") + - geom_text(aes(x = 1.2, label = author2), - position = position_fill(vjust = 0.5), color = "black" - ) + - geom_text(aes(x = 1.6, label = label), - position = position_fill(vjust = 0.5), color = "black" - ) + - theme_void() + - labs(x = NULL, y = NULL) -``` - -一种缓解拥挤的办法是通过 ggrepel 包在扇形区域旁边添加注释 - -```{r} -#| label: fig-pie-repel -#| fig-cap: "维护者提交量占比" -#| fig-width: 6.5 -#| fig-height: 5 -#| fig-showtext: true - -library(ggrepel) -dat1 <- aggregate(data = svn_trunk_log, revision ~ author, FUN = length) |> - transform(author2 = ifelse(revision < 1000, "Others", author)) |> - aggregate(revision ~ author2, FUN = sum) - -dat2 <- within(dat1, { - value <- 100 * revision / sum(revision) - csum <- rev(cumsum(rev(value))) - pos <- value / 1.5 + c(csum[-1], NA) - pos <- ifelse(is.na(pos), value / 2, pos) - label <- paste(author2, paste0(round(value, 2), "%"), sep = "\n") -}) - -ggplot(data = dat2, aes(x = 1, fill = author2, y = value)) + - geom_col(show.legend = FALSE, color = "white") + - coord_polar(theta = "y") + - geom_label_repel(aes(y = pos, label = label), - size = 4.5, nudge_x = 0.75, show.legend = FALSE - ) + - theme_void() + - labs(x = NULL, y = NULL) -``` - -但是数量很多的情况下,也是无能为力的,当然,是否需要显示那么多,是否可以合并占比小的部分,也是值得考虑的问题。 - -```{r} -#| echo: false -#| label: tbl-ctb-list -#| tbl-cap: "SVN 日志中的贡献者(部分)" - -# SVN 开发日志中的贡献者名字及其真实姓名(部分) -ctb_info <- tibble::tribble( - ~svn_name, ~ctb_name, ~comment, - "rgentlem", "Robert Gentleman", "R 语言创始人", - "ihaka", "Ross Ihaka", "R 语言创始人", - "ripley", "Brian Ripley", "R Core Team 中的核心", - "murrell", "Paul Murrell", "grid 包及栅格绘图系统", - "maechler", "Martin Maechler", "cluster / Matrix 包维护者", - "hornik", "Kurt Hornik", "R FAQ 和 CRAN 维护者", - "jmc", "John Chambers", "S 语言的创始人之一", - "bates", "Douglas Bates", "nlme / lme4 包核心开发者", - "pd", "Peter Dalgaard", "《统计导论与 R 语言》作者", - "ligges", "Uwe Ligges", "让 BUGS 与 R 同在", - "plummer", "Martyn Plummer", "让 JAGS 与 R 携手", - "luke", "Luke Tierney", "compiler 包核心开发者", - "iacus", "Stefano M. Iacus", "让 CRAN 拥抱 Fedora 系统", - "kalibera", "Tomas Kalibera", "编码问题终结者", - "deepayan", "Deepayan Sarkar", "lattice 包维护者", - "murdoch", "Duncan Murdoch", "R 软件的 Windows 版本维护者", - "duncan", "Duncan Temple Lang", "XML / RCurl 包开发者", - "urbaneks", "Simon Urbanek", "rJava / Rserve 包维护者" -) - -knitr::kable(ctb_info, col.names = c("SVN 花名", "真实名字", "主要贡献")) -``` - -### 环形饼图 {#sec-ring-pie} - -中间空了一块 - -```{r} -#| label: fig-ring-pie -#| fig-cap: "维护者提交量占比" -#| fig-width: 5 -#| fig-height: 4 -#| fig-showtext: true - -aggregate(data = svn_trunk_log, revision ~ author, FUN = length) |> - transform(author2 = ifelse(revision < 2000, "Others", author)) |> - aggregate(revision ~ author2, FUN = sum) |> - transform(label = paste0(round(revision / sum(revision), digits = 4) * 100, "%")) |> - ggplot(aes(x = 1, fill = author2, y = revision)) + - geom_col(position = "fill", show.legend = FALSE, color = "white") + - scale_y_continuous(labels = scales::label_percent()) + - coord_polar(theta = "y") + - geom_text(aes(x = 1.2, label = author2), - position = position_fill(vjust = 0.5), color = "black" - ) + - geom_text(aes(x = 1.7, label = label), - position = position_fill(vjust = 0.5), color = "black" - ) + - theme_void() + - labs(x = NULL, y = NULL) + - xlim(c(0.2, 1.7)) -``` - -### 扇形饼图 {#sec-sector-pie} - -扇形饼图又叫风玫瑰图或南丁格尔图 - -```{r} -#| label: fig-wind-rose -#| fig-cap: "维护者提交量分布" -#| fig-width: 5 -#| fig-height: 4.5 -#| fig-showtext: true - -aggregate(data = svn_trunk_log, revision ~ author, FUN = length) |> - transform(author2 = ifelse(revision < 2000, "Others", author)) |> - aggregate(revision ~ author2, FUN = sum) |> - ggplot(aes(x = reorder(author2, revision), y = revision)) + - geom_col(aes(fill = author2), show.legend = FALSE) + - coord_polar() + - theme_minimal() + - theme(axis.text.y = element_blank()) + - labs(x = NULL, y = NULL) -``` - -### 帕累托图 {#sec-pareto} - -```{=html} - -``` -除了饼图,还常用堆积柱形图描述各个部分的数量,柱形图的优势在于简洁,准确,兼顾对比和趋势。下 @fig-pareto-stack 描述各年开发者们的贡献量及其变化趋势,饼图无法表达数量的变化趋势。 - -```{r} -#| label: fig-pareto-stack -#| fig-cap: "代码提交量的比例趋势" -#| fig-showtext: true -#| fig-width: 7 -#| fig-height: 5 - -aggregate(data = svn_trunk_log, revision ~ year + author, FUN = length) |> - ggplot(aes(x = year, y = revision, fill = author)) + - geom_col() + - theme_classic() + - coord_cartesian(expand = FALSE) + - theme(legend.position = "bottom") + - labs(x = "年份", y = "提交量", fill = "开发者") -``` - -百分比堆积柱形图在数量堆积柱形图的基础上,将纵坐标的数量转化为百分比,下 @fig-pareto-fill 展示各年开发者代码提交比例的变化趋势。 - -```{r} -#| label: fig-pareto-fill -#| fig-cap: "代码提交量的比例趋势" -#| fig-showtext: true -#| fig-width: 7 -#| fig-height: 5 - -aggregate(data = svn_trunk_log, revision ~ year + author, FUN = length) |> - ggplot(aes(x = year, y = revision, fill = author)) + - geom_col(position = "fill") + - scale_y_continuous(labels = scales::label_percent()) + - theme_classic() + - coord_cartesian(expand = FALSE) + - theme(legend.position = "bottom") + - labs(x = "年份", y = "提交量", fill = "开发者") -``` - -帕累托图描述各个部分的占比,特别是突出关键要素的占比。收入常服从帕累托分布,这是一个幂率分布,比如 80% 的财富集中在 20% 的人的手中。下 @fig-pareto 展示过去 25 年各位开发者的代码累计提交量,提交量小于 1000 的已经合并为一类。不难看出,Ripley 的提交量远高于其他开发者。 - -```{r} -#| label: fig-pareto -#| fig-cap: "代码提交量的比例分布" -#| fig-showtext: true - -dat <- aggregate(data = svn_trunk_log, revision ~ author, FUN = length) |> - transform(author = ifelse(revision < 1000, "Others", author)) |> - aggregate(revision ~ author, FUN = sum) -dat <- dat[order(-dat$revision), ] - -ggplot(data = dat, aes(x = reorder(author, revision, decreasing = T), y = revision)) + - geom_col(width = 0.75) + - geom_line(aes(y = cumsum(revision), group = 1)) + - geom_point(aes(y = cumsum(revision))) + - theme_classic() + - theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) + - labs(x = "维护者", y = "累计提交量") -``` - -### 马赛克图 {#sec-mosic} - -马赛克图常用于展示多个分类数据,如 @fig-mosaic 所示,展示加州伯克利分校院系录取情况。 - -```{r} -#| label: fig-mosaic -#| fig-cap: "加州伯克利分校院系录取情况" -#| fig-width: 7 -#| fig-height: 5 -#| fig-showtext: true -#| warning: false - -library(ggmosaic) -ggplot(data = as.data.frame(UCBAdmissions)) + - geom_mosaic(aes(x = product(Dept, Gender), weight = Freq, fill = Admit)) + - theme_minimal() -``` - -::: callout-tip -Base R 提供函数 `plot()` 和 `mosaicplot()` 对 `table` 表格类型的数据可视化,提供一套公式绘图语法,可以绘制类似的马赛克图。 - -```{r} -#| label: fig-mosaic-base -#| fig-width: 7 -#| fig-height: 5 -#| fig-cap: "加州伯克利分校院系录取情况" -#| fig-showtext: true -#| echo: true -#| par: true -#| eval: false - -mosaicplot(~ Gender + Dept + Admit, - data = UCBAdmissions, color = TRUE, - main = "", xlab = "性别", ylab = "院系" -) -``` - -对于多维列联表数据,Base R 提供函数 `loglin()` 拟合对数线性模型,以获取更加定量的结果。更进一步,**MASS** 包在函数 `loglin()` 的基础上,打包了另一个函数 `loglm()` ,它提供与函数 `lm()` 和 `glm()` 相一致的公式语法,使用起来更加方便。当然,函数 `glm()` 本身也是可以拟合对数线性模型的,毕竟它也是一种特殊的广义线性模型。 -::: - -### 矩阵树图 {#sec-treemap} - -矩阵树图展示有层次的占比,比如 G20 国家的 GDP 按半球、地域分组。**treemapify** 包专门绘制矩阵树图,下 @fig-treemap 展示南北半球,各地域内各个国家 GDP 的占比。 - -```{r} -#| eval: true -#| echo: false -#| label: tbl-g20 -#| tbl-cap: "G20 国家经济水平:GDP 总量、人类发展指数等" - -library(treemapify) -data("G20") -knitr::kable(head(G20), col.names = c( - "区域", "国家", "GDP", - "人类发展指数", "经济水平", "所属半球" -)) -``` - -每个瓦片的大小代表国家的 GDP 在所属半球里的比重。 - -```{r} -#| label: fig-treemap -#| fig-cap: "G20 主要经济体的 GDP 占比" -#| fig-width: 7 -#| fig-height: 6 -#| fig-showtext: true - -ggplot(G20, aes(area = gdp_mil_usd, fill = region, label = country, subgroup = region)) + - geom_treemap() + - geom_treemap_text(grow = T, reflow = T, colour = "black") + - facet_wrap(~hemisphere) + - scale_fill_brewer(palette = "Set1") + - theme(legend.position = "bottom") + - labs(title = "G20 主要经济体", fill = "区域") -``` - -### 量表图 {#sec-likert-scale} - -展示调查研究中的用户态度。量表在市场调查,问卷调查,App 用户体验反馈等方面应用十分广泛,已经成为调查研究中的金标准。量表由心理学家 Rensis Likert 于 1932 年提出 [@Likert1932],[Likert Scale](https://en.wikipedia.org/wiki/Likert_scale) 就是以他的名字命名的。 - -量表在互联网产品中应用非常广泛,比如美团App里消息页面中的反馈框,用以收集用户使用产品的体验情况,如 @tbl-info-feedback 所示,从极其困难到极其方便,将用户反馈分成7个等级,目的是收集用户的反馈,以期改善产品的体验。 - -| 1 | 2 | 3 | 4 | 5 | 6 | 7 | -|:---------|:---------|:---------|:-----|:---------|:---------|:---------| -| 极其困难 | 非常困难 | 比较困难 | 一般 | 比较方便 | 非常方便 | 极其方便 | - -: 您觉得在本页面,找想看的消息方便吗? {#tbl-info-feedback} - -量表中的问题、观点的描述极其简单明了,对回答、表明态度的任何人都不会造成歧义,以确保不受文化差异、学历差异等的影响,受调查的人只需在待选的几个选项中圈选即可。候选项一般为 5-7 个,下面是一组典型的选项: - -1. Strongly disagree (强烈反对), -2. Disagree(反对), -3. Neither agree nor disagree(中立), -4. Agree(同意), -5. Strongly agree(强烈同意)。 - -Jason M. Bryer 开发了一个 R 包 [**likert**](https://github.com/jbryer/likert),特别适合调查研究数据可视化,将研究对象的态度以直观有效的方式展示出来,内置多个数据集,其中 @tbl-math-anxiety 是一个数学焦虑量表调查的结果,调查数据来自统计课上的 20 个学生。 - -调查对象是 78 个来自不同学科的本科生,样本含有 36 个男性和 42 个女性,64% 的样本的年龄在 18 至 24 岁,36% 的样本年龄 25 岁及以上。更多数据背景信息 [@Bai2009]。 - -| 观点 | 强烈反对 | 反对 | 中立 | 同意 | 强烈同意 | -|:-----------------------|---------:|---------:|---------:|---------:|---------:| -| I find math interesting. | 10 | 15 | 10 | 35 | 30 | -| I get uptight during math tests. | 10 | 20 | 20 | 25 | 25 | -| I think that I will use math in the future. | 0 | 0 | 20 | 25 | 55 | -| Mind goes blank and I am unable to think clearly when doing my math test. | 30 | 30 | 15 | 10 | 15 | -| Math relates to my life. | 5 | 20 | 10 | 40 | 25 | -| I worry about my ability to solve math problems. | 20 | 20 | 20 | 30 | 10 | -| I get a sinking feeling when I try to do math problems. | 35 | 10 | 15 | 35 | 5 | -| I find math challenging. | 5 | 10 | 15 | 45 | 25 | -| Mathematics makes me feel nervous. | 20 | 25 | 15 | 25 | 15 | -| I would like to take more math classes. | 20 | 25 | 30 | 20 | 5 | -| Mathematics makes me feel uneasy. | 25 | 15 | 20 | 25 | 15 | -| Math is one of my favorite subjects. | 35 | 15 | 25 | 20 | 5 | -| I enjoy learning with mathematics. | 15 | 25 | 30 | 20 | 10 | -| Mathematics makes me feel confused. | 15 | 20 | 15 | 35 | 15 | - -: 你对数学感到焦虑吗? {#tbl-math-anxiety tbl-colwidths="\[40,15,10,10,10,15\]"} - -相比于 **ggplot2** 绘制的普通条形图, @fig-likert-scale 有一些独特之处:对立型的渐变色表示两个不同方向的态度,左右两侧以中立态度为中间位置,非常形象,并且按照其中一个方向的态度数据排序,显得比较整齐有序,便于理解。 - -```{r} -#| label: fig-likert-scale -#| fig-cap: 你喜欢数学吗 -#| fig-width: 8.5 -#| fig-height: 5 -#| fig-showtext: true - -# 数据来自 likert 包 -MathAnxiety <- readRDS(file = "data/MathAnxiety.rds") -# 宽转长格式 -MathAnxiety_df <- reshape(data = MathAnxiety, - varying = c("Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"), - times = c("Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"), - timevar = "Attitude", v.names = "Numbers", idvar = "Item", - new.row.names = 1:(5 * 14), direction = "long" - ) - -MathAnxiety_df$Attitude <- factor(MathAnxiety_df$Attitude, levels = c( - "Strongly Agree", "Agree", "Neutral", "Disagree", "Strongly Disagree" -), labels = c( - "强烈同意", "同意", "中立", "反对", "强烈反对" -), ordered = TRUE) - -ggplot(data = MathAnxiety_df, aes(x = Numbers, y = Item)) + - geom_col(aes(fill = Attitude), position = "fill") + - scale_x_continuous(labels = scales::label_percent()) + - scale_y_discrete(labels = scales::label_wrap(25)) + - scale_fill_brewer(palette = "BrBG", direction = -1) + - theme_classic() + - guides(fill = guide_legend(reverse = TRUE)) + - coord_cartesian(expand = FALSE) + - labs(x = "占比", y = "问题", fill = "态度") -``` - -[**likert**](http://github.com/jbryer/likert) 包的函数 `likert()` 适合对聚合的调查数据绘图。 - -```{r} -#| label: fig-likert-math -#| fig-width: 7 -#| fig-height: 5 -#| eval: false -#| echo: true -#| fig-cap: Likert 图 - -library(likert) -lmath <- likert(summary = MathAnxiety) -plot(lmath) -``` - -而 [**ggstats**](https://github.com/larmarange/ggstats/) 包的函数 `gglikert()` 适合对明细的调查数据绘图。下面模拟一次调查收集到的数据,共计 150 人回答 6 个问题,每个问题都有 5 个候选项构成。 - -```{r} -library(ggstats) -likert_levels <- c("强烈反对", "反对", "中立", "同意", "强烈同意") -set.seed(2023) -library(data.table) -df <- data.table( - q1 = sample(likert_levels, 150, replace = TRUE), - q2 = sample(likert_levels, 150, replace = TRUE, prob = 5:1), - q3 = sample(likert_levels, 150, replace = TRUE, prob = 1:5), - q4 = sample(likert_levels, 150, replace = TRUE, prob = 1:5), - q5 = sample(c(likert_levels, NA), 150, replace = TRUE), - q6 = sample(likert_levels, 150, replace = TRUE, prob = c(1, 0, 1, 1, 0)) -) -fkt <- paste0("q", 1:6) -df[, (fkt) := lapply(.SD, factor, levels = likert_levels), .SDcols = fkt] -``` - -一个调查问卷共有 6 个题目,150 个人对 6 个问题的回答构成一个数据框 `df` 。 - -```{r} -#| label: fig-likert-fake -#| fig-cap: Likert 图 -#| fig-width: 5 -#| fig-height: 4 -#| fig-showtext: true - -gglikert(df) -``` - -## 习题 {#sec-visualization-intermediate-exercise} - -1. 根据 Github 代码提交量数据制作日历图。 - - ```{r} - #| label: fig-github-profile - #| fig-cap: Github 打卡日历图 - #| fig-width: 8 - #| fig-height: 4 - #| fig-showtext: true - #| echo: !expr knitr::is_html_output() - - github_ctb <- jsonlite::read_json(path = "data/contributions.json") - github_df <- data.frame( - date = unlist(lapply(github_ctb$contributions, "[[", "date")), - count = unlist(lapply(github_ctb$contributions, "[[", "count")), - color = unlist(lapply(github_ctb$contributions, "[[", "color")), - intensity = unlist(lapply(github_ctb$contributions, "[[", "intensity")) - ) - week.abb <- c("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat") - github_df <- within(github_df, { - date <- as.Date(date) - year <- format(date, format = "%Y", tz = "UTC") - month <- format(date, format = "%m", tz = "UTC") - week <- format(date, format = "%U", tz = "UTC") - wday <- format(date, format = "%a", tz = "UTC") - nday <- format(date, format = "%j", tz = "UTC") - week <- as.integer(week) - wday <- factor(wday, labels = week.abb) - }) - ggplot( - data = subset(github_df, subset = year %in% 2020:2022), - aes(x = week, y = wday, fill = count) - ) + - geom_tile(color = "white", linewidth = 0.5) + - scale_fill_distiller(palette = "Greens", direction = 1) + - scale_x_continuous( - expand = c(0, 0), breaks = seq(1, 52, length = 12), labels = month.abb - ) + - facet_wrap(~year, ncol = 1) + - theme_minimal() + - labs(x = "月份", y = "星期", fill = "提交量") - ``` diff --git a/visualization-lattice.qmd b/visualization-lattice.qmd deleted file mode 100644 index 563cb345..00000000 --- a/visualization-lattice.qmd +++ /dev/null @@ -1,843 +0,0 @@ -# lattice 入门 {#sec-basic-lattice} - -```{r} -#| echo: false - -source("_common.R") -``` - -> If you imagine that this pen is Trellis, then Lattice is not this pen. -> -> --- Paul Murrell [^visualization-lattice-1] - -[^visualization-lattice-1]: Paul 在 DSC 2001 大会上的[幻灯片](https://www.stat.auckland.ac.nz/~paul/Talks/dsc2001.pdf)。 - -**lattice** 最初是受到商业统计软件 S/S-Plus 中的 Trellis 组件启发,打算在 R 软件中重新实现一套新的绘图系统,在使用接口上保持与 Trellis 兼容,Trellis 使用文档也同样适用于 **lattice**。 - -本章主要介绍 **lattice** 包 [@Deepayan2008] 及其相关的 **latticeExtra** 包。 - -```{r} -#| message: false - -library(lattice) -library(latticeExtra) -library(splines) -library(nlme) -library(mgcv) -library(maps) -library(sf) -library(RColorBrewer) -``` - -## 分组散点图 {#sec-lattice-xyplot} - -函数 `xyplot()` 在 lattice 包中非常具有代表性,掌握此函数的作图规律,其它函数学起来也就不难了。分组散点图是一个非常常见的、用来描述变量之间关系的图形,下面就以绘制一个分组散点图来介绍函数 `xyplot()` 的用法。 - -```{r} -#| label: fig-lattice-xyplot-1 -#| fig-width: 4.5 -#| fig-height: 4 -#| fig-showtext: true -#| fig-cap: 分组散点图 - -library(lattice) -xyplot( - x = Sepal.Length ~ Petal.Length, groups = Species, scales = "free", - data = iris, grid = TRUE, xlab = "萼片长度", ylab = "花瓣长度", - auto.key = list(space = "top", columns = 3) -) -``` - -- 参数 `x` 需要传递 R 语言中的表达式,这是一种被广泛使用的公式语法,示例中为 `Sepal.Length ~ Petal.Length` ,表示横坐标为 `Petal.Length`, 纵坐标为 `Sepal.Length` 。 -- 参数 `groups` 指定分组变量,此处为 `Species` 变量,表示鸢尾花种类。 -- 参数 `scales` 设置坐标轴刻度, `scales = "free"` 表示去掉边框上面和右面的刻度线。 -- 参数 `data` 指定绘图数据,此处为 `iris` 数据集。 -- 参数 `grid` 控制是否添加背景网格线,此处为 `TRUE` 表示添加背景网格线。 -- 参数 `xlab` 和参数 `ylab` 分别指定横、纵坐标轴标签。 -- 参数 `auto.key` 设置图例,示例中设置 `space = "top"` 将图例置于图形上方,设置 `columns = 3` 使条目排成 3 列,此外,设置 `reverse.rows = TRUE` 还可以使图例中的条目顺序反向。 - -除了通过 `space` 参数设置图例的位置,还可以通过坐标设置图例的位置,比如下 @fig-lattice-xyplot-key-2 中设置图例的位置坐标为 `x = 1, y = 0` 使得图例位于图的右下角。图例坐标的参考点是原点 `x = 0, y = 0` 就是左下角的位置,而右上角的位置为 `x = 1, y = 1` 。 - -```{r} -#| label: fig-lattice-xyplot-key -#| fig-width: 5.5 -#| fig-height: 4 -#| layout-ncol: 1 -#| fig-showtext: true -#| fig-cap: 调整图例位置 -#| fig-subcap: -#| - 图例位于图右侧 -#| - 图例位于内内部 - -xyplot( - Sepal.Length ~ Petal.Length, groups = Species, data = iris, - scales = "free", grid = TRUE, xlab = "萼片长度", ylab = "花瓣长度", - auto.key = list(space = "right", columns = 1) -) -xyplot( - Sepal.Length ~ Petal.Length, groups = Species, data = iris, - scales = "free", grid = TRUE, xlab = "萼片长度", ylab = "花瓣长度", - auto.key = list(corner = c(1, 0)) -) -``` - -除了上面介绍的几个参数,还有许多其它参数,其中一部分会在后续介绍其它种类的图形时顺带介绍,剩余的部分请感兴趣的读者查看函数 `xyplot()` 的帮助文档。 - -## 图形参数 {#sec-lattice-par} - -类似 Base R 绘图系统中的图形参数设置函数 `par()`和 **ggplot2** 包中的主题设置函数 `theme()`, **lattice** 包也有图形参数设置函数 `trellis.par.set()` ,而图形参数查询函数为 `trellis.par.get()` 。可设置的图形参数非常多,仅常用的也不少。首先来看看有哪些图形参数可以设置。 - -```{r} -tp <- trellis.par.get() -names(tp) -``` - -可以看到,图形参数着实非常多,知道了这么多图形参数,而每个参数又有哪些选项可取呢?不忙,再看看图形参数的结构,比如 `superpose.symbol` 。 - -```{r} -tp$superpose.symbol -``` - -这是一个列表,有 6 个元素,每个元素设置符号的不同属性,依次是透明度 `alpha`、大小 `cex`、颜色 `col`、填充色 `fill`、字型 `font` 和类型 `pch` ,这些属性的含义与函数 `par()` 是一致的。下 @fig-lattice-par 展示所有的常用图形参数及其可设置的选项。 - -```{r} -#| label: fig-lattice-par -#| fig-cap: 常用图形参数 -#| fig-width: 6 -#| fig-height: 8 -#| echo: false -#| fig-showtext: true - -# 修改自帮助文档 ?trellis.par.get() -tp <- trellis.par.get() -# 去掉不常用的参数设置选项 -unusual <- c( - "grid.pars", "fontsize", "clip", "axis.components", - "layout.heights", "layout.widths" -) -tp[names(tp) %in% unusual] <- NULL -# 抽取 pars 中的参数名称 -extract_names <- function(name, pars) { - expand.grid(x = name, y = names(`[[`(pars, name)), z1 = 1) -} -# 抽取结果保存为 data.frame -dat1 <- do.call("rbind", lapply(names(tp), FUN = extract_names, pars = tp)) -# 初始化数据框 -dat2 <- data.frame( - expand.grid(x = levels(dat1$x), y = levels(dat1$y)), - z2 = 0 -) -# 填充数据框 -dat <- merge(x = dat2, y = dat1, by = c("x", "y"), all.x = T) -dat <- within(dat, { - z <- z1 | z2 -}) - -# 绘图 -levelplot(z ~ y * x, - data = dat, scales = list( - draw = T, - # 去掉图形上边、右边多余的刻度线 - x = list(rot = 45, alternating = 1, tck = c(1, 0)), - y = list(alternating = 1, tck = c(1, 0)) - ), - xlab = "参数值名称", ylab = "图形参数", colorkey = FALSE, - panel = function(x, y, z, ...) { - panel.abline( - v = unique(as.numeric(x)), - h = unique(as.numeric(y)), - col = "grey" - ) - panel.xyplot(x, y, pch = 16 * z, ...) - } -) -``` - -现在,知道了图形设置参数及其结构,还需要知道它们究竟在绘图时起什么作用,也就是说它们控制图形中的哪部分元素及效果。下 @fig-lattice-settings 展示 **lattice** 包图形参数效果。由图可知,图形参数 `superpose.symbol` 是控制散点图中的点,点可以是普通的点,也可以是任意的字母符号。 - -```{r} -#| label: fig-lattice-settings -#| fig-cap: 图形参数效果预览 -#| echo: false -#| fig-width: 6.5 -#| fig-height: 6.5 -#| fig-showtext: true - -show.settings(x = trellis.par.set(list( - axis.text = list(fontfamily = "sans"), # 轴标签字体 - add.text = list(fontfamily = "mono"), # 注释文本字体 - par.main.text = list(fontfamily = "sans"), # 主标题字体 - par.sub.text = list(fontfamily = "serif") # 副标题字体 -))) -``` - -在之前的 @fig-lattice-xyplot-1 的基础上,设置 `type = c("p", "r")` 添加回归线。通过图形参数 `par.settings` 设置各类绘图元素的符号类型和大小,该参数接受一个列表类型的数据,列表的元素还是列表,列表的层层嵌套实现图中元素的精细控制。列表元素 `superpose.symbol` 控制点的符号,`pch = 16` 设置为 16,相比于默认的点要大一号。列表元素 `superpose.line` 控制线,`lwd = 2` 设置宽度为 2,比默认的宽度大一倍,`lty = 3` 设置线的类型为 3,表示虚线。通过参数 `auto.key` 设置图例位置,图例位于图形上方,图例中的条目排成3列。 - -```{r} -#| label: fig-lattice-xyplot-2 -#| fig-width: 5.5 -#| fig-height: 4.5 -#| fig-showtext: true -#| fig-cap: 调整点、线、图例元素 - -xyplot( - Sepal.Length ~ Petal.Length, groups = Species, data = iris, - scales = "free", grid = TRUE, type = c("p", "r"), - xlab = "萼片长度", ylab = "花瓣长度", - auto.key = list(columns = 3, space = "top"), - par.settings = list( - superpose.symbol = list(pch = 16), - superpose.line = list(lwd = 2, lty = 3) - ) -) -``` - -**latticeExtra** 包有两个函数专门用来设置图形风格,分别是 `theEconomist.theme()` 和 `ggplot2like()` ,这两个主题函数提供一系列预设的图形参数,前者来自《经济学人》杂志的图形主题,后者来自 **ggplot2** 包的默认绘图主题。 - -```{r} -#| label: fig-lattice-extra-themes -#| fig-width: 5.5 -#| fig-height: 4 -#| fig-showtext: true -#| fig-cap: latticeExtra 内置的两个主题 -#| layout-ncol: 1 -#| fig-subcap: -#| - ggplot2 包默认的绘图主题 -#| - 《经济学人》杂志的绘图主题 - -library(latticeExtra) -xyplot( - Sepal.Length ~ Petal.Length, groups = Species, data = iris, - scales = "free", grid = TRUE, xlab = "萼片长度", ylab = "花瓣长度", - auto.key = list(space = "top", columns = 3), - par.settings = ggplot2like() -) -xyplot( - Sepal.Length ~ Petal.Length, groups = Species, data = iris, - scales = "free", grid = TRUE, xlab = "萼片长度", ylab = "花瓣长度", - auto.key = list(space = "top", columns = 3), - par.settings = theEconomist.theme(with.bg = TRUE, box = "transparent") -) -``` - -```{r} -#| eval: false -#| echo: false -# 等价的 ggplot2 表示 -library(ggplot2) -ggplot(data = iris, aes(x = Sepal.Length, y = Petal.Length)) + - geom_point(aes(color = Species)) + - scale_color_brewer(palette = "Set1", name = "") + - theme(legend.position = "top") -``` - -## 常见图形 {#sec-common-lattice} - -### 分组柱形图 {#sec-lattice-barchart} - -本节所用数据集 `Insurance` 来自 **MASS** 包,记录一家保险公司面临风险的投保人数量,以及在 1973 年第 3 季度他们提出汽车理赔的数量。数据类型、各个变量的类型及部分预览数据如下: - -```{r} -data(Insurance, package = "MASS") -str(Insurance) -``` - -其中,District 表示投保人居住的地区,因子型变量。Group 汽车按油箱大小分组的变量,有序的因子型变量。Age 投保人的年龄段标签,有序的因子型变量。Holders 投保人数量,整型变量。Claims 理赔数量,整型变量。下 @fig-lattice-barchart 先按投保人的汽车类型分面,再按投保人所在地区分组,展示理赔频度与投保人年龄的关系。 - -```{r} -#| label: fig-lattice-barchart -#| fig-width: 6 -#| fig-height: 6 -#| fig-cap: 分组柱形图 -#| fig-showtext: true - -barchart( - Claims / Holders ~ Age | Group, groups = District, - data = Insurance, xlab = "年龄段", ylab = "理赔频度", - auto.key = list(space = "top", columns = 4, title = "地区", cex.title = 1) -) -``` - -函数 `barchart()` 中的公式 `Claims / Holders ~ Age | Group` ,斜杠 `/` 表示除法,波浪线 `~` 表示响应变量与自变量的分界,竖线 `|` 表示分面。 - -### 分组箱线图 {#sec-lattice-boxplot} - -```{r} -#| label: fig-lattice-bwplot -#| fig-width: 4.5 -#| fig-height: 4 -#| fig-cap: 分组箱线图 -#| fig-showtext: true - -bwplot(Petal.Length ~ Species, data = iris, scales = "free", - xlab = "鸢尾花种类", ylab = "花瓣长度") -``` - -### 经验分布图 {#sec-lattice-step} - -用阶梯图表示累积经验分布图,纵轴表示累积概率,不同种类的鸢尾花,花瓣长度的分布明显不同。根据 Glivenko--Cantelli 定理,经验分布函数以概率 1 收敛至累积分布函数。 - -```{r} -#| label: fig-lattice-ecdfplot -#| fig-showtext: true -#| fig-cap: 经验分布图 -#| fig-width: 6 -#| fig-height: 4 - -library(latticeExtra) -ecdfplot(~ Petal.Length | Species, data = iris, scales = "free", - xlab = "花瓣长度", ylab = "累积概率") -``` - -### 回归曲线图 {#sec-lattice-smoother} - -- **splines** 自然立方样条 `ns()` -- **mgcv** 广义可加模型 `s()` - -```{r} -#| label: fig-lattice-colours -#| fig-width: 3 -#| fig-height: 3 -#| fig-cap: 调色板 -#| fig-showtext: true -#| echo: false - -scales::show_col(colours = c("#4285f4", "#34A853", "#FBBC05", "#EA4335")) -``` - -@fig-lattice-smoother 中用不同的回归模型拟合数据中的趋势。1920s 汽车行驶距离和速度的关系图。函数 `panel.smoother()` 来自 **latticeExtra** 包 - -```{r} -#| label: fig-lattice-smoother -#| fig-width: 4.5 -#| fig-height: 4 -#| layout-ncol: 2 -#| layout-nrow: 2 -#| fig-cap: 回归曲线图 -#| fig-subcap: -#| - 线性回归 -#| - 局部多项式回归 -#| - 自然样条回归 -#| - 广义可加回归 -#| fig-showtext: true -#| message: false - -library(splines) -library(nlme) -library(mgcv) -xyplot(dist ~ speed, - data = cars, scales = "free", xlab = "速度", ylab = "距离", - panel = function(x, y, ...) { - panel.xyplot(x, y, ...) - panel.smoother(y ~ x, - col.line = "#EA4335", method = "lm", ... - ) - } -) -xyplot(dist ~ speed, - data = cars, scales = "free", xlab = "速度", ylab = "距离", - panel = function(x, y, ...) { - panel.xyplot(x, y, ...) - panel.smoother(y ~ x, - col.line = "#4285f4", method = "loess", span = 0.9, ... - ) - } -) -xyplot(dist ~ speed, - data = cars, scales = "free", xlab = "速度", ylab = "距离", - panel = function(x, y, ...) { - panel.xyplot(x, y, ...) - panel.smoother(y ~ ns(x, 5), - col.line = "#34A853", method = "lm", ... - ) - } -) -xyplot(dist ~ speed, - data = cars, scales = "free", xlab = "速度", ylab = "距离", - panel = function(x, y, ...) { - panel.xyplot(x, y, ...) - panel.smoother(y ~ s(x), - col.line = "#FBBC05", method = "gam", ... - ) - } -) -``` - -### 置信区间图 {#sec-lattice-segplot} - -各个郡县每 10 万人当中因癌症死亡的人数。`USCancerRates` 数据集来自 **latticeExtra** 包,记录各个郡县的癌症死亡率及其置信区间,下图展示新泽西州各个郡县的癌症死亡率及其置信区间。 - -```{r} -#| label: fig-lattice-segplot -#| fig-width: 6 -#| fig-height: 5 -#| fig-cap: 置信区间图 -#| fig-showtext: true - -segplot(reorder(county, rate.male) ~ LCL95.male + UCL95.male, - data = subset(USCancerRates, state == "New Jersey"), - draw.bands = FALSE, centers = rate.male, - scales = list(x = list(alternating = 1, tck = c(1, 0))), - xlab = "癌症死亡率", ylab = "郡县" -) -``` - -### 置信椭圆图 {#sec-lattice-ellipse} - -**latticeExtra** 包的函数 `panel.ellipse()` 可以绘制置信椭圆。二维数据,置信水平为 0.95 时,置信椭圆。 - -```{r} -#| label: fig-lattice-ellipse -#| fig-width: 4.5 -#| fig-height: 4 -#| fig-showtext: true -#| fig-cap: 分组置信椭圆图 - -xyplot(Sepal.Length ~ Petal.Length, - groups = Species, data = iris, scales = "free", - xlab = "萼片长度", ylab = "花瓣长度", - par.settings = list( - superpose.symbol = list(pch = 16), - superpose.line = list(lwd = 2, lty = 3) - ), - panel = function(x, y, ...) { - panel.xyplot(x, y, ...) - panel.ellipse(x, y, level = 0.85, ...) - }, - auto.key = list(space = "top", columns = 3) -) -``` - -### 切片水平图 {#sec-lattice-facet} - -按照深度降序排列,根据震级 mag 划分 4 个区间,每个区间内数据点的数量比较平衡,相邻区间之间有重叠部分。对数据进行切片,观察连续的切片数据,增加一个维度。 - -对震深排序的目的是让数据点按照一定的顺序绘制在图上,数据点相距较近容易互相覆盖。使得在二维平面上,通过对数据点的染色,也能体现地震深度在空间中的层次变化。 - -不同的震级下,地震深度在空间中的变化是一致的。 - -```{r} -# 震级区间 -quakes$Magnitude <- equal.count(quakes$mag, number = 4) -# 震深 -depth.ord <- rev(order(quakes$depth)) -quakes.ordered <- quakes[depth.ord, ] -``` - -``` -Intervals: - min max count -1 3.95 4.55 484 -2 4.25 4.75 492 -3 4.45 4.95 425 -4 4.65 6.45 415 - -Overlap between adjacent intervals: -[1] 293 306 217 -``` - -函数 `equal.count()` 内部调用函数 `co.intervals()` ,还有两个参数 `number` 和 `overlap`。如果要没有重叠的话,得设置 `overlap = 0` 。 - -```{r} -#| eval: false - -quakes$Magnitude <- equal.count(quakes$mag, number = 4, overlap = 0) -``` - -```{r} -#| label: fig-lattice-levelplot -#| fig-cap: 分面水平图 -#| fig-width: 6.5 -#| fig-height: 6 -#| fig-showtext: true - -levelplot(depth ~ long + lat | Magnitude, - data = quakes.ordered, scales = "free", - panel = panel.levelplot.points, - prepanel = prepanel.default.xyplot, - type = c("p", "g"), layout = c(2, 2) -) -``` - -### 三维散点图 {#sec-lattice-cloud} - -**lattice** 包的函数 `cloud()` 三维散点图 - -```{r} -#| label: fig-lattice-cloud -#| fig-cap: 三维散点图 -#| fig-width: 4.5 -#| fig-height: 4.5 -#| fig-showtext: true - -cloud(Sepal.Length ~ Sepal.Width + Petal.Length, - groups = Species, data = iris, - # 去掉方向箭头 - scales = list(arrows = FALSE, col = "black"), - xlab = list("萼片宽度", rot = 30), - ylab = list("花瓣长度", rot = -35), - zlab = list("萼片长度", rot = 90), - # 减少三维图形的边空 - lattice.options = list( - layout.widths = list( - left.padding = list(x = -0.5, units = "inches"), - right.padding = list(x = -1.0, units = "inches") - ), - layout.heights = list( - bottom.padding = list(x = -1.5, units = "inches"), - top.padding = list(x = -1.5, units = "inches") - ) - ), - par.settings = list( - # 点的类型 - superpose.symbol = list(pch = 16), - # 去掉外框线 - axis.line = list(col = "transparent") - ) -) -``` - -下面是一个示例,自定义面板函数 `panel.3d.cloud` 。 - -::: callout-note -图底部的网格待改进,生成网格线的代码太死板。 -::: - -```{r} -#| label: fig-lattice-rongelap -#| fig-cap: 添加三维网格参考线和透视曲线 -#| fig-showtext: true -#| fig-width: 5.2 -#| fig-height: 3.5 - -# 加载数据 -rongelap <- readRDS(file = "data/rongelap.rds") -rongelap_coastline <- readRDS(file = "data/rongelap_coastline.rds") - -library(lattice) -# 参考 lattice 书籍的图 6.5 的绘图代码 -panel.3dcoastline <- function(..., rot.mat, distance, xlim, ylim, zlim, - xlim.scaled, ylim.scaled, zlim.scaled) { - scale.vals <- function(x, original, scaled) { - scaled[1] + (x - original[1]) * diff(scaled) / diff(original) - } - scaled.map <- rbind( - scale.vals(rongelap_coastline$cX, xlim, xlim.scaled), - scale.vals(rongelap_coastline$cY, ylim, ylim.scaled), - zlim.scaled[1] - ) - m <- ltransform3dto3d(scaled.map, rot.mat, distance) - panel.lines(m[1, ], m[2, ], col = "black") -} - -rongelap_grid_line <- rbind.data.frame( - data.frame(x = 1000 * -6:0, y = -3500), - data.frame(x = 1000 * 0:-6, y = -3000), - data.frame(x = 1000 * -6:0, y = -2500), - data.frame(x = 1000 * 0:-6, y = -2000), - data.frame(x = 1000 * -6:0, y = -1500), - data.frame(x = 1000 * 0:-6, y = -1000), - data.frame(x = 1000 * -6:0, y = -500), - data.frame(x = 1000 * 0:-6, y = 0), - data.frame(x = -6000, y = -500 * 7:0), - data.frame(x = -5000, y = -500 * 0:7), - data.frame(x = -4000, y = -500 * 7:0), - data.frame(x = -3000, y = -500 * 0:7), - data.frame(x = -2000, y = -500 * 7:0), - data.frame(x = -1000, y = -500 * 0:7), - data.frame(x = 0, y = -500 * 7:0) -) - -panel.3dgridline <- function(..., rot.mat, distance, xlim, ylim, zlim, - xlim.scaled, ylim.scaled, zlim.scaled) { - scale.vals <- function(x, original, scaled) { - scaled[1] + (x - original[1]) * diff(scaled) / diff(original) - } - scaled.map <- rbind( - scale.vals(rongelap_grid_line$x, xlim, xlim.scaled), - scale.vals(rongelap_grid_line$y, ylim, ylim.scaled), - zlim.scaled[1] - ) - m <- ltransform3dto3d(scaled.map, rot.mat, distance) - panel.lines(x = m[1,], y = m[2,], col = "gray", lty = 2) -} - -cloud(counts / time ~ cX * cY, - data = rongelap, col = "black", - xlim = c(-6500, 100), ylim = c(-3800, 150), - scales = list(arrows = FALSE, col = "black"), - aspect = c(0.75, 0.5), - xlab = list("横坐标(米)", rot = 20), - ylab = list("纵坐标(米)", rot = -50), - zlab = list("辐射强度", rot = 90), - type = c("p", "h"), pch = 16, lwd = 0.5, - panel.3d.cloud = function(...) { - panel.3dgridline(...) - panel.3dcoastline(...) # 海岸线 - panel.3dscatter(...) - }, - # 减少三维图形的边空 - lattice.options = list( - layout.widths = list( - left.padding = list(x = -0.5, units = "inches"), - right.padding = list(x = -1.0, units = "inches") - ), - layout.heights = list( - bottom.padding = list(x = -1.5, units = "inches"), - top.padding = list(x = -1.5, units = "inches") - ) - ), - par.settings = list( - # 移除几条内框线 - # box.3d = list(col = c(1, 1, NA, NA, 1, NA, 1, 1, 1)), - # 刻度标签字体大小 - axis.text = list(cex = 0.8), - # 去掉外框线 - axis.line = list(col = "transparent") - ), - # 设置三维图的观察方位 - screen = list(z = 30, x = -65, y = 0) -) -``` - -### 三维透视图 {#sec-lattice-wireframe} - -有如下参数方程 - -$$ -\begin{aligned} -\left\{ - \begin{array}{l} -x(u,v) = \cos(u)\big(r + \cos(u / 2)\big) \\ -y(u,v) = \sin(u)\big(r + \cos(u / 2)\sin(tv) - \sin(u / 2)\sin(2tv)\big)\sin(tv) - - \sin(u / 2)\sin(2tv) \\ -z(u,v) = \sin(u / 2) \sin(tv) + \cos(u / 2) \sin(tv) -\end{array} \right. -\end{aligned} -$$ - -其中,$u$ 和 $v$ 是参数,$\frac{u}{2\pi} \in [0.3,1.25], \frac{v}{2\pi} \in [0,1]$,$r$ 和 $t$ 是常量,不妨设 $r = 2$ 和 $t=1$ 。 - -```{r} -#| label: fig-lattice-wireframe -#| fig-cap: 三维透视图 -#| fig-width: 4.5 -#| fig-height: 4.5 -#| fig-showtext: true - -# lattice 书 6.3.1 节 参数 -kx <- function(u, v) cos(u) * (r + cos(u / 2)) -ky <- function(u, v) { - sin(u) * (r + cos(u / 2) * sin(t * v) - - sin(u / 2) * sin(2 * t * v)) * sin(t * v) - - sin(u / 2) * sin(2 * t * v) -} -kz <- function(u, v) sin(u / 2) * sin(t * v) + cos(u / 2) * sin(t * v) -n <- 50 -u <- seq(0.3, 1.25, length = n) * 2 * pi -v <- seq(0, 1, length = n) * 2 * pi -um <- matrix(u, length(u), length(u)) -vm <- matrix(v, length(v), length(v), byrow = TRUE) -r <- 2 -t <- 1 - -wireframe(kz(um, vm) ~ kx(um, vm) + ky(um, vm), - shade = TRUE, drape = FALSE, - xlab = expression(x[1]), ylab = expression(x[2]), - zlab = list(expression( - italic(f) ~ group("(", list(x[1], x[2]), ")") - ), rot = 90), alpha = 0.75, - scales = list(arrows = FALSE, col = "black"), - # 减少三维图形的边空 - lattice.options = list( - layout.widths = list( - left.padding = list(x = -0.5, units = "inches"), - right.padding = list(x = -1.0, units = "inches") - ), - layout.heights = list( - bottom.padding = list(x = -1.5, units = "inches"), - top.padding = list(x = -1.5, units = "inches") - ) - ), - par.settings = list(axis.line = list(col = "transparent")), - screen = list(z = 30, x = -65, y = 0) -) -``` - -绘图函数 `wireframe()` 支持使用公式语法,也支持矩阵类型的数据绘制透视图。 - -```{r} -#| label: fig-wireframe-volcano -#| fig-cap: 奥克兰火山地形图 -#| fig-width: 6 -#| fig-height: 5.5 -#| fig-showtext: true - -wireframe(volcano, - drape = TRUE, colorkey = FALSE, shade = TRUE, - xlab = list("南北方向", rot = -40), - ylab = list("东西方向", rot = 45), - zlab = list("高度", rot = 90), - # 减少三维图形的边空 - lattice.options = list( - layout.widths = list( - left.padding = list(x = -.6, units = "inches"), - right.padding = list(x = -1.0, units = "inches") - ), - layout.heights = list( - bottom.padding = list(x = -.8, units = "inches"), - top.padding = list(x = -1.0, units = "inches") - ) - ), - # 设置坐标轴字体大小 - par.settings = list( - axis.line = list(col = "transparent"), - fontsize = list(text = 12, points = 10) - ), - scales = list(arrows = FALSE, col = "black"), - screen = list(z = -45, x = -50, y = 0) -) -``` - -### 地形轮廓图 {#sec-lattice-contour} - -绘图函数 `levelplot()` 支持使用公式语法,也支持矩阵类型的数据绘制轮廓图。基于奥克兰火山地形数据 volcano 绘制轮廓图,volcano 是矩阵类型的数据。 - -```{r} -#| label: fig-levelplot-volcano -#| fig-cap: 奥克兰火山的地形轮廓图 -#| fig-width: 6 -#| fig-height: 4 -#| fig-showtext: true - -levelplot(volcano, useRaster = TRUE, - # 去掉图形上、右边多余的刻度线 - scales = list( - x = list(alternating = 1, tck = c(1, 0)), - y = list(alternating = 1, tck = c(1, 0)) - ), - par.settings = list( - # x/y 轴标签字体,刻度标签字体 - par.xlab.text = list(fontfamily = "Noto Serif CJK SC"), - par.ylab.text = list(fontfamily = "Noto Serif CJK SC"), - axis.text = list(fontfamily = "sans") - ), - xlab = "南北方向", ylab = "东西方向" -) -``` - -函数 `levelplot()` 的参数 `col.regions` 需要传递一个函数,示例中使用的默认设置。常见的函数有 `hcl.colors()` 、 `gray.colors()` 、`terrain.colors()` 、`cm.colors()` 和 `topo.colors()` 等,函数 `hcl.colors()` 默认使用 `viridis` 调色板,还可以用函数 `colorRampPalette()` 构造调色板函数。 - -```{r} -#| label: fig-levelplot-topo -#| fig-width: 4.5 -#| fig-height: 4 -#| fig-showtext: true -#| fig-cap: 奥克兰火山的地形轮廓图 - -data(topo, package = "MASS") -levelplot(z ~ x * y, data = topo, scales = "free", - panel = panel.2dsmoother, contour = TRUE, - form = z ~ s(x, y, bs = "gp", k = 50), method = "gam", - xlab = "水平方向", ylab = "垂直方向" -) -``` - -函数 `panel.2dsmoother()` 来自 **latticeExtra** 包,数据的二维分布,默认采用 `tp` - -- `tp` thin plate regression spline 回归样条方法平滑。 -- `cr` Cubic regression spline 立方回归样条。 -- `gp` Gaussian process smooths 高斯过程平滑,默认为全秩 Full Rank,指定 k 低秩近似 Low Rank。 - -### 地区分布图 {#sec-lattice-mapplot} - -最后一个想要介绍的是地区分布图,也叫面量图、围栏图,描述空间栅格数据的分布,常见的一种情况是展示各个地区的人口、社会、经济指标。下面通过 **tigris** 包可以下载美国人口调查局发布的数据,本想下载与观测数据年份最近的地图数据,但是 2009 年及以前的地图数据缺失,因此,笔者下载了 2010 年的地图数据,它与得票率数据最近。 - -```{r} -#| eval: false -#| echo: true - -library(tigris) -us_state_map <- states(cb = TRUE, year = 2010, resolution = "20m", class = "sf") -us_state_map <- shift_geometry(us_state_map, geoid_column = "STATE", position = "below") -``` - -第一行代码用 **tigris** 包的函数 `states()` 下载 2010 年比例尺为 1:20000000 的多边形州边界矢量地图数据,返回一个 simple feature 类型的空间数据类型。第二行代码用该包的另一个函数 `shift_geometry()` 移动离岸的州和领地,将它们移动到主体部分的下方。 - -```{r} -#| message: false - -library(sf) -us_state_sf <- readRDS("data/us-state-map-2010.rds") -# sf 转 sp -us_state_sp <- as(us_state_sf, "Spatial") -library(maps) -# sp 转 map -us_state_map <- SpatialPolygons2map(us_state_sp, namefield = "NAME") -# 准备观测数据 -data(votes.repub) -# 转为 data.frame 类型 -votes_repub <- as.data.frame(votes.repub) -``` - -数据集 `votes.repub` 记录 1856-1976 年美国历届大选中共和党在各州的得票率。图中以由红到蓝的颜色变化表示由低到高的得票率,1964 年共和党在东南一隅得票率较高,在其它地方得票率普遍较低,形成一边倒的情况,最终由民主党的林登·约翰逊当选美国第36任总统。1968 年共和党在东南部得票率最低,与 1964 年相比,整个反过来了,最终由共和党的理查德·尼克松当选美国第37任总统。 - -```{r} -#| label: fig-lattice-choropleth -#| fig-showtext: true -#| fig-width: 5 -#| fig-height: 5 -#| fig-cap: 共和党在各州的得票率 - -library(RColorBrewer) -rdbu_pal <- colorRampPalette(colors = brewer.pal(n = 11, name = "RdBu")) -mapplot(rownames(votes_repub) ~ `1964` + `1968`, data = votes_repub, - border = NA, map = us_state_map, colramp = rdbu_pal, layout = c(1, 2), - scales = list(draw = FALSE), xlab = "", ylab = "" -) -``` - -参数 `border` 设置州边界线的颜色,NA 表示去掉边界线。参数 `map` 设置州边界地图数据。参数 `colramp` 设置一个调色板,用于将得票率与调色板上的颜色映射起来。美国历届大选,共和党和民主党竞争总统职位,最终由得票率决定,用红蓝对抗型调色板表现竞争关系。基于 **RColorBrewer** 包的 `RdBu` 调色板,用函数 `colorRampPalette()` 构造一个新的红蓝调色板。参数 `layout` 将多个子图按照一定顺序排列,图中设置 2 行 1 列的多图布局。参数 `scales` 用来调整刻度,设置 `list(draw = FALSE)` 将图中的刻度去掉了。参数 `xlab` 设置一个空字符,即 `xlab = ""` 可去掉横坐标轴标签,参数 `ylab` 应用于设置纵坐标,用法与参数 `xlab` 一样。图中,主要表现得票率在各州的分布,因此,坐标轴刻度和标签都不太重要,可以去掉。 - -## 总结 {#sec-basic-lattice-summary} - -现在回过头来看,无论是图形样式还是绘图语法, **lattice** 可以看作是介于 Base R 和 **ggplot2** 之间的一种绘图风格。举例来说,下面比较 Base R 和 **lattice** 的图形样式。 - -```{r} -#| label: fig-lattice-vs-base -#| fig-width: 4 -#| fig-height: 4 -#| fig-showtext: true -#| fig-cap: 对比 Base R 和 lattice 制作的分组散点图 -#| layout-ncol: 2 -#| par: true -#| fig-subcap: -#| - Base R 图形 -#| - lattice 图形 - -plot(Sepal.Length ~ Petal.Length, col = Species, data = iris, - xlab = "萼片长度", ylab = "花瓣长度") -xyplot(Sepal.Length ~ Petal.Length, groups = Species, data = iris, - scales = "free", xlab = "萼片长度", ylab = "花瓣长度") -``` - -与函数 `plot()` 对应的是函数 `xyplot()` ,它们共用一套公式语法,参数 `data` 的含义也是一样的。与参数 `col` 对应的是参数 `groups` ,作用是添加数据分组标识。在两个函数中,添加横纵坐标轴标签都是用参数 `xlab` 和 `ylab` 。函数 `xyplot()` 中参数 `scales` 的作用是对坐标轴刻度的调整,参数值 `"free"` 表示去掉图形上边和右边的刻度线,默认情况下是有刻度线的。 - -在高级的绘图函数方面,Base R 和 **lattice** 基本都有功能对应的函数,在低水平的绘图函数方面,二者截然不同,主要是因为后者基于另一套绘图系统 --- **grid** 绘图系统。Base R 作图常常需要一个函数一个函数地不断叠加,在图中画上点、线、轴、标签等元素,而 **lattice** 主要通过面板函数,层层叠加的方式,每一个面板函数实现一个功能,整合一系列绘图操作。本章主要介绍 **lattice** 包和 **latticeExtra** 包,用到的高级绘图函数如下表。 - -| R 包 | 函数 | 图形 | 作用 | -|------------------|----------------------|----------------|--------------| -| **lattice** | `xyplot()` | (分组)散点图 | 描述关系 | -| **lattice** | `bwplot()` | (分组)箱线图 | 描述分布 | -| **lattice** | `barchart()` | (分组)柱形图 | 描述对比 | -| **lattice** | `levelplot()` | 切片水平图 | 描述趋势 | -| **lattice** | `wireframe()` | 三维透视图 | 描述趋势 | -| **lattice** | `cloud()` | 三维散点图 | 描述分布 | -| **latticeExtra** | `panel.smoother()` | 回归曲线图 | 描述趋势 | -| **latticeExtra** | `panel.2dsmoother()` | 地形轮廓图 | 描述趋势 | -| **latticeExtra** | `ecdfplot()` | 经验分布图 | 描述分布 | -| **latticeExtra** | `segplot()` | 置信区间图 | 描述不确定性 | -| **latticeExtra** | `panel.ellipse()` | 置信椭圆图 | 描述不确定性 | -| **latticeExtra** | `mapplot()` | 地区分布图 | 描述分布 | - -: lattice 和 latticeExtra 包的部分函数 {#tbl-lattice-extra} diff --git a/visualization-practice.qmd b/visualization-practice.qmd deleted file mode 100755 index 60f5b528..00000000 --- a/visualization-practice.qmd +++ /dev/null @@ -1,576 +0,0 @@ -# 探索实践 {#sec-visualization-practice} - -```{r} -#| echo: false - -source("_common.R") -``` - -## 分析老忠实间歇泉喷发规律 {#sec-faithful} - -@fig-faithful-bkde2d 展示美国怀俄明州黄石国家公园[老忠实间歇泉](https://en.wikipedia.org/wiki/Old_Faithful)喷发规律,横轴表示喷发持续时间(以分钟计),纵轴表示等待时间(以分钟计),点的亮暗程度(白到黑)代表附近点密度的高低,亮度值通过二维核密度估计方法得到,具体实现借助了 **KernSmooth** [@KernSmooth1995] 包提供的 `bkde2D()` 函数,设置了喷发时间的窗宽为 0.7 分钟,等待时间的窗宽为 7分钟。不难看出,每等待 55 分钟左右间歇泉喷发约 2 分钟,或者每等待 80 分钟左右间歇泉喷发 4.5 约分钟,非常守时,表现得很老实,故而得名。说实话,二维核密度估计在这里有点大材小用了,因为数据点比较少,肉眼也能分辨出来哪里聚集的点多,哪里聚集的点少。 - -```{r} -#| label: fig-faithful-bkde2d -#| echo: !expr knitr::is_html_output() -#| code-fold: true -#| par: true -#| fig-cap: "二维核密度估计" -#| fig-subcap: -#| - "faithful 数据集的散点图" -#| - "点的亮暗表示核密度估计值的大小" -#| - "等高线表示核密度估计值" -#| - "等高线表示核密度估计值" -#| fig-width: 4.5 -#| fig-height: 4.5 -#| fig-showtext: true -#| message: false -#| layout-ncol: 2 - -# faithful 添加二维核密度估计 density 列 -library(KernSmooth) -den <- bkde2D(x = faithful, bandwidth = c(0.7, 7), gridsize = c(51L, 51L)) -faithful2d <- expand.grid(eruptions = den$x1, waiting = den$x2) |> - transform(density = as.vector(den$fhat)) - -plot(faithful, - pch = 20, panel.first = grid(), cex = 1, ann = FALSE, - xlim = c(0.5, 6.5), - ylim = c(35, 100) -) -title(xlab = "喷发时间", ylab = "等待时间", family = "Noto Serif CJK SC") - -plot(faithful, - pch = 20, panel.first = grid(), cex = 1, ann = FALSE, - xlim = c(0.5, 6.5), - ylim = c(35, 100), - col = densCols(faithful, - bandwidth = c(0.7, 7), - nbin = c(51L, 51L), colramp = hcl.colors - ) -) -title(xlab = "喷发时间", ylab = "等待时间", family = "Noto Serif CJK SC") - -plot(faithful, - pch = 20, panel.first = grid(), cex = 1, ann = FALSE, - xlim = c(0.5, 6.5), - ylim = c(35, 100), - col = densCols(faithful, - bandwidth = c(0.7, 7), - nbin = c(51L, 51L), colramp = hcl.colors - ) -) -contour(den$x1, den$x2, den$fhat, nlevels = 10, add = TRUE, family = "sans") -title(xlab = "喷发时间", ylab = "等待时间", family = "Noto Serif CJK SC") - -# 散点添加颜色 -mkBreaks <- function(u) u - diff(range(u)) / (length(u) - 1) / 2 -# faithful 划入网格内 -xbin <- cut(faithful[, 1], mkBreaks(den$x1), labels = FALSE) -ybin <- cut(faithful[, 2], mkBreaks(den$x2), labels = FALSE) -# 网格对应的核密度估计值即为 faithful 对应的核密度估计值 -faithful$dens <- den$fhat[cbind(xbin, ybin)] -# 若是 faithful 数据点没有划分,则置为 0 -faithful$dens[is.na(faithful$dens)] <- 0 - -library(ggplot2) -library(ggnewscale) -ggplot() + - geom_point( - data = faithful, aes(x = eruptions, y = waiting, color = dens), - shape = 20, size = 2, show.legend = FALSE - ) + - scale_colour_viridis_c(option = "D") + - new_scale_color() + - geom_contour(data = faithful2d, aes( - x = eruptions, y = waiting, - z = density, colour = after_stat(level) - ), bins = 14, linewidth = 0.45, show.legend = FALSE) + - scale_colour_viridis_c(option = "C", direction = -1, begin = 0.2, end = 0.8) + - # colorspace::scale_color_continuous_sequential(palette = "Grays") + - scale_x_continuous(breaks = 1:6) + - scale_y_continuous(breaks = 10 * 4:10) + - coord_cartesian(xlim = c(0.5, 6.5), ylim = c(35, 100)) + - labs(x = "喷发时间", y = "等待时间", colour = "密度") + - theme_bw(base_size = 13) + - theme( - legend.title = element_text(family = "Noto Serif CJK SC"), - axis.title = element_text(family = "Noto Serif CJK SC"), - axis.title.x = element_text( - margin = margin(b = 0, l = 0, t = 20, r = 0) - ), - axis.title.y = element_text( - margin = margin(b = 0, l = 0, t = 0, r = 20) - ), - panel.border = element_rect(color = "black"), - panel.grid = element_blank(), - panel.grid.major = element_line( - color = "lightgray", - linetype = 3, linewidth = 0.5 - ), - axis.ticks.length = unit(0.25, "cm"), - axis.text.x = element_text( - family = "sans", color = "black", - vjust = -1.5, size = rel(1.25) - ), - axis.text.y = element_text( - family = "sans", color = "black", - angle = 90, vjust = 1.5, hjust = 0.5, - size = rel(1.25) - ) - ) -``` - -::: callout-tip -函数 `bkde2D()` 实现二维带窗宽的核密度估计(2D Binned Kernel Density Estimate),R 语言存在多个版本,**grDevices** 包的函数 `densCols()` 直接调用 **KernSmooth** 包的函数 `bkde2D()`,**graphics** 包的函数 `smoothScatter()` 与函数 `densCols()` 一样,内部也是调用 `bkde2D()` 函数,**ggplot2** 包的图层 `geom_density_2d()` 采用 **MASS** 包的函数 `kde2d()`,在算法实现上,`MASS::kde2d()` 与 `KernSmooth::bkde2D()` 不同,前者是二维核密度估计(Two-Dimensional Kernel Density Estimation)。Tarn Duong 的著作 [《Multivariate Kernel Smoothing and Its Applications 》](https://www.mvstat.net/mvksa/) [@Chacon2018] 对多元核平滑方法及其应用作了专门的论述,相关实现见书籍配套的 **ks** 包。 -::: - -```{r} -#| eval: false -#| echo: false - -# 三维交互式图形 -dens <- with(faithful, MASS::kde2d(x = waiting, y = eruptions)) -library(plotly) -with(dens, plot_ly(x = x, y = y, z = z, type = "surface")) -``` - -## 中国地区级男女性别比分布 {#sec-china-household-sex} - -@fig-china-household-sex-1 展示 2020 年中国各省、自治区和直辖市分城市、镇和乡村的性别比数据。数据来自中国国家统计局发布的 2021 年统计年鉴,在数据量不太大的情况下,尽可能展示原始数据,可以捕捉到更加细致的差异。社会经济相关的数据常常显示有马太效应,对原始数据适当做一些变换有利于比较和展示数据,@fig-china-household-sex-2 展示对数变换后的性别比数据的分布。大部分地区的性别比数据都在 100:100 左右,流动人口的性别比波动大很多。 - -```{r} -#| label: fig-china-household-sex -#| echo: !expr knitr::is_html_output() -#| code-fold: true -#| fig-cap: "2020 年中国地区级男女性别比分布" -#| fig-subcap: -#| - 原始性别比数据 -#| - 对数变换后的性别比数据 -#| fig-width: 7 -#| fig-height: 4.5 -#| fig-showtext: true - -china_household_sex <- readRDS(file = "data/china-household-sex-2020.rds") -ggplot(data = china_household_sex, aes(x = `户口登记状况`, y = `男性` / `女性`)) + - geom_jitter(aes(color = `区域`), width = 0.3) + - theme_classic() - -ggplot(data = china_household_sex, aes(x = `户口登记状况`, y = `男性` / `女性`)) + - geom_jitter(aes(color = `区域`), width = 0.3) + - scale_y_continuous(trans = "log10") + - theme_classic() -``` - -- 「住本乡、镇、街道,户口在本乡、镇、街道」土著和已获得当地户口的。性别比分布有明显的层次差异,性别比均值从大到小依次是城市、乡村、镇。城市里,男性略多于女性,镇里,男性明显少于女性,乡村里,男性略低于女性。 -- 「住本乡、镇、街道,户口待定」黑户或其它。性别比分布有明显的层次差异。同上。 -- 「住本乡、镇、街道,户口在外乡、镇、街道,离开户口登记地半年以上」流出人口,流出乡、镇、街道。城市、镇、乡村的性别比数据充分混合了,性别比分布没有明显的层次差异。 -- 「居住在港澳台或国外,户口在本乡、镇、街道」流出人口,流出国。同上。 - -## 美国历年各年龄死亡率变化 {#sec-usa-mortality} - - - -@fig-usa-mortality 展示美国 1933-2020 年男性分年龄的死亡率数据[^visualization-practice-1]。图分上下两部分,上半部分展示死亡率原值随年龄的变化情况,以 ggplot2 默认的调色板给各个年份配色,下半部分展示死亡率对数变换后随年龄的变化情况,并以红、橙、黄、绿、青、蓝、紫构造彩虹式的调色板给各个年份配色。作图过程中,使用对数变换和调用彩虹式的调色板,帮助我们观察到更多的细节、层次。对数变换后,更加清晰地展示死亡率的变化,尤其是 0-20 岁之间的死亡率起伏变化。调用彩虹式的调色板后,约 20 年为一个阶段,每个阶段内呈现梯度变化,多个阶段体现层次性,更加清晰地展示死亡率曲线的变动趋势。透过层次看到 80 多年来,美国在医疗和公共卫生方面取得的显著改善。 - -[^visualization-practice-1]: 数据来自德国马克斯普朗克人口研究所、美国加州大学伯克利分校、法国人口研究所共同建立的人类死亡率数据库 ()。 - -```{r} -#| label: fig-usa-mortality -#| fig-cap: "1933-2020 年美国男性死亡率曲线" -#| fig-width: 6 -#| fig-height: 6 -#| echo: !expr knitr::is_html_output() -#| fig-showtext: true -#| code-fold: true - -usa_mortality <- readRDS(file = "data/usa-mortality-2020.rds") -library(patchwork) -p1 <- ggplot(data = usa_mortality, aes(x = Age, y = Male, group = Year)) + - geom_vline(xintercept = "100", colour = "gray", lty = 2) + - geom_line(aes(color = Year), linewidth = 0.25) + - scale_x_discrete( - breaks = as.character(20 * 0:5), - labels = as.character(20 * 0:5) - ) + - theme_classic() -p2 <- p1 + - labs(x = "年龄", y = "死亡率", color = "年份") -p3 <- p1 + - scale_y_log10(labels = scales::label_log()) + - scale_colour_gradientn(colors = RColorBrewer::brewer.pal(name = "Spectral", n = 11)) + - labs(x = "年龄", y = "死亡率(对数尺度)", color = "年份") -p2 / p3 -``` - -@fig-usa-mortality 也展示了很多基础信息,出生时有很高的死亡率,出生后死亡率迅速下降,一直到10岁,死亡率才又开始回升,直到 20 岁,死亡率才回到出生时的水平。之后,在青年阶段死亡率缓慢增加,直至老年阶段达到很高的死亡率水平。相比于老年阶段,医疗水平的改善作用主要体现在婴儿、儿童、青少年阶段。 - -@fig-usa-mortality 还展示了一个潜在的数据质量问题,在 100 岁之后,死亡率波动程度明显在变大,这是因为高龄人数变得很少,即死亡率的分母变得很小,分子的细小波动会被放大,也因为同样的原因,100 岁以上的死亡率主要依赖模型估计,甚至出现死亡率大于 1 的罕见情况。因此,就对比医疗和公共卫生水平的变化而言,从数据的实际情况出发,100 岁以上的情况可以不参与比较。 - -@fig-usa-mortality-heatmap 以年份为横轴,以年龄为纵轴绘制网格,网格内部根据男性死亡率数据填充颜色制作热力图,死亡率数据是对数尺度,颜色的变化和死亡率的变化关系同前,采用了相同的调色板。更加深入的分析和建模,详见 @Marron2022 的第一章。 - -```{r} -#| label: fig-usa-mortality-heatmap -#| fig-cap: "1933-2020 年美国男性死亡率热力图" -#| fig-width: 6.5 -#| fig-height: 4.5 -#| echo: !expr knitr::is_html_output() -#| fig-showtext: true -#| code-fold: true - -ggplot(data = usa_mortality, aes(x = Year, y = Age, fill = Male)) + - scale_fill_gradientn( - colors = RColorBrewer::brewer.pal(name = "Spectral", n = 11), - trans = "log10", labels = scales::percent_format() - ) + - geom_tile(linewidth = 0.4) + - scale_y_discrete( - breaks = as.character(10 * 0:10), - labels = as.character(10 * 0:10), - expand = c(0, 0) - ) + - scale_x_continuous( - breaks = 1940 + 10 * 0:8, - labels = 1940 + 10 * 0:8, - expand = c(0, 0) - ) + - theme_classic() + - labs(x = "年份", y = "年龄", fill = "死亡率") -``` - -## 美国弗吉尼亚州城乡死亡率 {#sec-virginia-deaths} - -VADeaths 数据来自 Base R 内置的 datasets 包,记录 1940 年美国弗吉尼亚州死亡率,如下表。 - -```{r} -#| label: tbl-virginia-deaths -#| tbl-cap: 1940 年美国弗吉尼亚州死亡率 -#| echo: false - -knitr::kable(VADeaths, row.names = TRUE, - col.names = c("农村男", "农村女", "城市男", "城市女")) -``` - -死亡率数据是按年龄段、城乡、性别分组统计的,这是一个三因素交叉统计表,表格中第1行第1列的数据表示 50-54 岁乡村男性的死亡率为 11.7 ‰ ,即在 50-54 岁乡村男性群体中,1000 个人中死亡 11.7 个,这是抽样调查出来的数字。下图分年龄段、城乡、性别展示弗吉尼亚州死亡率数据,从图例来看,突出的是各年龄段的对比,图主要传递的信息是各年龄段的死亡率差异。无论城市还是乡村,也无论男性还是女性,年龄越大死亡率越高,这完全是一个符合生物规律的客观事实,这是众人皆知的,算不上洞见。 - -```{r} -#| label: fig-virginia-age-group -#| fig-cap: 弗吉尼亚州各年龄段死亡率的对比 -#| fig-width: 6 -#| fig-height: 5 -#| fig-showtext: true -#| echo: !expr knitr::is_html_output() -#| code-fold: true - -dat <- transform(expand.grid( - site = c("乡村", "城镇"), sex = c("男", "女"), - age = ordered(c("50-54", "55-59", "60-64", "65-69", "70-74")) -), deaths = as.vector(t(VADeaths)) / 1000) - -library(ggplot2) -# (\u2030) 表示千分号 -ggplot(data = dat, aes(x = sex, y = deaths, fill = age)) + - geom_col(position = "dodge2") + - scale_y_continuous(labels = scales::label_percent(scale = 1000, suffix = "\u2030")) + - scale_fill_brewer(palette = "Spectral") + - facet_wrap(~site, ncol = 1) + - theme_bw(base_size = 13) + - labs(x = "性别", y = "死亡率", fill = "年龄") -``` - -将对比对象从年龄段转变为城乡,描述城乡差距在死亡率上的体现,是不是一下子更深刻了呢?城市降低各个年龄段的死亡率,暗示着城市的居住条件、医疗水平比乡村好,提高城市化率增加全民的寿命。严格来说,就这个粗糙的数据集不能如此快地下这个结论,但是,它暗示这个信息,同样也符合人们的常识。 - -```{r} -#| label: fig-virginia-population-group -#| fig-cap: 弗吉尼亚州城乡死亡率的对比 -#| fig-width: 6 -#| fig-height: 5 -#| fig-showtext: true -#| echo: !expr knitr::is_html_output() -#| code-fold: true - -ggplot(data = dat, aes(x = age, y = deaths, fill = site)) + - geom_col(position = "dodge2") + - scale_y_continuous(labels = scales::label_percent(scale = 1000, suffix = "\u2030")) + - scale_fill_brewer(palette = "Spectral") + - facet_wrap(~sex, ncol = 1) + - theme_bw(base_size = 13) + - labs(x = "年龄", y = "死亡率", fill = "城乡") -``` - -## 如何用图表示累积概率分布 {#sec-diamonds-distr} - -不失一般性,考虑连续随机变量的条件分布和累积分布。不妨设随机变量 $x$ 的概率分布函数和概率密度函数分别是 $F(x)$ 和 $f(x)$ 。已知概率分布函数和概率密度函数之间有如下关系。 - -$$ -F(x) = \int_{-\infty}^{x} f(t) \mathrm{dt} -$$ - -diamonds 数据来自 ggplot2 包,记录了约 54000 颗钻石的价格、重量、切工、颜色、纯净度、尺寸等属性信息。@fig-diamonds-distr 展示这批不同切工的钻石随价格的分布,在这个示例中,如何表达累积分布?概率分布的密度曲线是根据直方图估计得来的,根据不同价格区间内钻石的数量占总钻石的比例估计概率。固定窗宽,即在同一价格区间内累积不同切工的钻石数量,得到累积概率,最后获得累积概率密度曲线,更多理论细节见数据可视化陷阱 [@pu2020] 。 - -```{r} -#| label: fig-diamonds-distr -#| fig-cap: 不同切工的钻石随价格的分布 -#| fig-width: 6 -#| fig-height: 5 -#| echo: !expr knitr::is_html_output() -#| fig-showtext: true -#| code-fold: true - -library(ggplot2) -library(patchwork) -p1 <- ggplot(diamonds, aes(x = price, y = after_stat(density), fill = cut)) + - geom_density(position = "stack", colour = "white") + - scale_fill_brewer(palette = "Spectral") + - scale_y_continuous( - labels = expression(0, 5~"·"~10^-4, 10 ~ "·" ~ 10^-4, 15 ~ "·" ~ 10^-4), - breaks = c(0, 5, 10, 15) * 10^(-4) - ) + - theme_bw(base_family = "Noto Serif CJK SC") + - labs(x = "价格", y = "概率密度", fill = "切工", tag = "坏") + - theme( - axis.text.x = element_text(family = "sans", color = "black"), - axis.text.y = element_text( - family = "sans", color = "black", - angle = 90, vjust = 1.5, hjust = 0.5 - ), - legend.text = element_text(family = "sans"), - plot.tag = element_text(family = "Noto Serif CJK SC", color = "red"), - plot.tag.position = "topright" - ) - -p2 <- ggplot(diamonds, aes(x = price, y = after_stat(density * n), fill = cut)) + - geom_density(position = "stack", colour = "white") + - scale_fill_brewer(palette = "Spectral") + - theme_bw(base_family = "Noto Serif CJK SC") + - labs(x = "价格", y = "概率质量", fill = "切工", tag = "好") + - theme( - axis.text.x = element_text(family = "sans", color = "black"), - axis.text.y = element_text( - family = "sans", color = "black", - angle = 90, vjust = 1.5, hjust = 0.5 - ), - legend.text = element_text(family = "sans"), - plot.tag = element_text(family = "Noto Serif CJK SC", color = "black"), - plot.tag.position = "topright" - ) - -p1 / p2 -``` - -## 解释二项总体参数的置信带 {#sec-confidence-belt} - -0 和 1 是世界的原点,蕴含大道真意,从 0-1 分布也叫伯努利分布,独立同 0-1分布之和可以衍生出二项分布。在一定条件下,可以用泊松分布近似二项分布。根据中心极限定理,独立同二项分布的极限和与正态分布可以发生关系。在二项分布、正态分布的基础上,可以衍生出超几何分布、贝塔分布等等。本书多个地方以二项分布为例介绍基本统计概念和模型。 - -在给定置信水平为 0.95,即 $\alpha = 0.05$,固定样本量 $n = 10$,观测到的成功次数 $x$ 可能为 $0,1,\cdots,10$。对于给定的 $p$,不同 $x$ 值出现的机率 $P(X = x)$ 由 $(p + q)^{10}$ 二项展开式的项给出,这里 $q = 1-p$,即: - -$$ -P(X = x) = \binom{n}{x}p^x(1-p)^{n-x} -$$ {#eq-binom-probability} - -在给定 $p = 0.1$ 的情况下,求二项分布的上 $\alpha/2 = 0.025$ 分位点,尾项之和不应超过 $\alpha/2$,最大的 $x$ 值可有如下方程给出: - -$$ -\sum_{r = x}^{n}\binom{n}{x}p^x(1-p)^{n-x} = \frac{\alpha}{2} -$$ {#eq-binom-quantile} - -在 R 语言中,函数 `qbinom()` 可以计算上述二项分布的上分位点 $x = 3$,即 - -```{r} -qbinom(0.025, size = 10, prob = 0.1, lower.tail = F) -``` - -反过来,若已知上分位点为 $x = 3$,则概率为 - -$$ -P(X > 3) = \sum_{x > 3}^{10}\binom{10}{x}0.1^x*(1-0.1)^{10-x} -$$ {#eq-binom-prob} - -在 R 语言中,函数 `pbinom()` 可以计算上述二项分布的上分位点对应的概率为 $0.0127952$。 - -```{r} -pbinom(q = 3, size = 10, prob = 0.1, lower.tail = F) -``` - -首先简单回顾一下置信区间,在学校和教科书里,有两种说法如下: - -1. $1-\alpha$ 的把握确定区间包含真值。 -2. 区间包含真值的概率是 $1-\alpha$。 - -为什么要采纳第一种说法而不是第二种呢?这其实涉及到置信区间的定义问题,历史上 E. S. Pearson 和 R. A. Fisher 曾有过争论。和大多数以正态分布为例介绍参数的置信估计不同,下面以二项分布为例展开介绍。我们知道二项分布是 N 个伯努利分布的卷积,而伯努利分布又称为 0-1 分布,最形象的例子要数抛硬币了,反复投掷硬币,将正面朝上记为 1,反面朝上记为 0,记录正反面出现的次数,正面朝上的总次数又叫成功次数。 - -1934 年 C. J. Clopper 和 E. S. Pearson 在给定置信水平 $1- \alpha = 0.95$ 和样本量 $n = 10$ 的情况下,给出二项分布 $B(n, p)$ 参数 $p$ 的区间估计(即所谓的 Clopper-Pearson 精确区间估计)和置信带 [@Clopper1934],如 @fig-confidence-belt 所示,横坐标为观测到的成功次数,纵坐标为参数 $p$ 的置信限。具体来说,固定样本量为 10,假定观测到的成功次数为 2,在置信水平为 0.95 的情况下,Base R 内置的二项精确检验函数 `binom.test()`,可以获得参数 $p$ 的精确区间估计为 $(p_1, p_2) = (0.025, 0.556)$,即: - -```{r} -# 精确二项检验 p = 0.2 -binom.test(x = 2, n = 10, p = 0.2) -``` - -值得注意,这个估计的区间与函数 `binom.test()` 中参数 `p` 的取值无关,也就是说,当 $p = 0.4$,区间估计结果是一样的,如下: - -```{r} -# 精确二项检验 p = 0.4 -binom.test(x = 2, n = 10, p = 0.4) -``` - -由此,也可以看出区间估计与假设检验的一些关系。 - -```{=html} - -``` -```{r} -#| label: fig-confidence-belt -#| fig-cap: "二项分布参数的置信带" -#| echo: !expr knitr::is_html_output() -#| code-fold: true -#| fig-width: 5 -#| fig-height: 5 -#| fig-showtext: true -#| par: true - -library(rootSolve) # uniroot.all -options(digits = 4) -# r 为上分位点 -p_fun <- function(p, r = 9) qbinom(0.025, size = 10, prob = p, lower.tail = F) - r # 上分位点 -l_fun <- function(p, r = 9) qbinom(0.025, size = 10, prob = p, lower.tail = T) - r # 下分位点 - -# 计算每个分位点对应的最小的概率 p -p <- sapply(0:10, function(x) min(uniroot.all(p_fun, lower = 0, upper = 1, r = x))) - -# 计算每个分位点对应的最大的概率 l -l <- sapply(0:10, function(x) max(uniroot.all(l_fun, lower = 0, upper = 1, r = x))) - -plot( - x = seq(from = 0, to = 10, length.out = 11), - y = seq(from = 0, to = 1, length.out = 11), - type = "n", ann = FALSE, family = "sans", panel.first = grid() -) -title(xlab = "成功次数", ylab = "置信限", family = "Noto Serif CJK SC") -lines(x = 0:10, y = p, type = "s") # 朝下的阶梯线 -lines(x = 0:10, y = p, type = "l") # 折线 -# points(x = 0:10, y = p, pch = 16, cex = .8) # 散点 - -# abline(a = 0, b = 0.1, col = "gray", lwd = 2, lty = 2) # 添加对称线 -text(x = 5, y = 0.5, label = "置信带", cex = 1.5, srt = 45, family = "Noto Serif CJK SC") -# points(x = 5, y = 0.5, col = "black", pch = 16) # 中心对称点 -# points(x = 5, y = 0.5, col = "black", pch = 3) # 中心对称点 - -lines(x = 0:10, y = l, type = "S") # 朝上的阶梯线 -lines(x = 0:10, y = l, type = "l") # 折线 -# points(x = 0:10, y = l, pch = 16, cex = .8) # 散点 - -points(x = c(2, 2), y = c(0.03, 0.55), pch = 8, col = "black") -text(x = 2, y = 0.55, labels = expression(p[2]), pos = 1) -text(x = 2, y = 0.03, labels = expression(p[1]), pos = 3) -``` - -## 解释置信区间及其覆盖概率 {#sec-coverage-probability} - - - -统计图形很重要的一个作用是解释统计概念,这就要求不拘泥于抽象的严格数学表达,借助数值模拟,可视化等手段帮助读者发散思维,加深理解复杂的逻辑概念,建立统计直觉,正如顾恺之所言「以形写神,形神兼备」。下面仅以二项分布为例讲讲区间估计及其覆盖概率。众所周知,在置信水平为 $1 - \alpha$ 的情况下,二项分布 $\mathrm{Bin}(n,p)$ 的参数 $p$ (也叫成功概率)的 Wald 区间估计为 - -$$ -(\hat{p} - Z_{1-\alpha/2} \sqrt{\hat{p}*(1-\hat{p})/n}, \hat{p} + Z_{1-\alpha/2} \sqrt{\hat{p}*(1-\hat{p})/n}) -$$ {#eq-wald-ci} - -其中,$n$ 为样本量,$Z_{1-\alpha/2}$ 为标准正态分布 $\mathcal{N}(0,1)$ 在 $1-\alpha/2$ 处的分位点。 $\alpha$ 一般取 0.05,进而 $Z_{1-\alpha/2} \approx 1.96$。用通俗的话说,有 $1 - \alpha$ 的把握确定参数真值 $p$ 在该估计区间内。可见区间估计的意义是解决点估计可靠性问题,但是可靠性和精度往往不能兼得。统计上,通常的做法是先给定可靠性,去尽可能提升精度,即给定置信水平,使估计区间的长度尽可能短,这就涉及到区间估计的方法问题。 - -下面通过数值模拟的方式辅助说明 Wald 和 Agresti-Coull 两种区间估计方法,现固定样本量 $n = 10$ 或 $n = 100$,重复抽样 1000 次,将参数 $p$ 以 0.01 的间隔离散化,从 0.01 取值到 0.99。已知给定参数 $p$,每次抽样都可以得到参数 $p$ 的估计值 $\hat{p}$ 及其置信区间,1000 次的重复抽样可以计算出来 1000 个置信区间,每个区间要么覆盖真值,要么没有覆盖真值,覆盖的比例可以近似为覆盖概率。 - -如 @fig-coverage 所示,从上往下分别代表 Wald、 Agresti-Coull、 Wilson 和 Clopper-Pearson 区间估计,纵坐标是覆盖概率,横坐标是参数 $p$ 的真值,图中黑虚线表示置信水平 $1-\alpha=0.95$,红、蓝点线分别表示样本量 $n=10$ 和 $n=100$ 的模拟情况。不难看出,Wald 区间估计方法在小样本情况下表现很差,覆盖概率很少能达到置信水平的,而 Agresti-Coull 区间估计在 Wald 基础上添加了修正后,情况得到显著改善。更多区间估计方法的详细比较见文献 @Blyth1960;@Lawrence2001;@Geyer2005 。 - -```{r} -#| label: fig-coverage -#| fig-cap: "二项分布参数的几种区间估计:覆盖概率随成功概率的变化" -#| fig-width: 6 -#| fig-height: 8.5 -#| fig-showtext: true -#| echo: !expr knitr::is_html_output() -#| code-fold: true - -# 计算覆盖概率 -# Wald 覆盖 -coverage_wald <- function(p = 0.1, n = 10, nsim = 1000) { - phats <- rbinom(nsim, prob = p, size = n) / n - ll <- phats - qnorm(1 - 0.05 / 2) * sqrt(phats * (1 - phats) / n) - ul <- phats + qnorm(1 - 0.05 / 2) * sqrt(phats * (1 - phats) / n) - mean(ll < p & ul > p) -} -# Agresti-Coull 覆盖 -coverage_agresti <- function(p = 0.1, n = 10, nsim = 1000) { - phats <- (rbinom(nsim, prob = p, size = n) + 2) / (n + 4) - ll <- phats - qnorm(1 - 0.05 / 2) * sqrt(phats * (1 - phats) / n) - ul <- phats + qnorm(1 - 0.05 / 2) * sqrt(phats * (1 - phats) / n) - mean(ll < p & ul > p) -} -# Clopper and Pearson (1934) -# 与 binom.test() 计算结果一致 -coverage_clopper <- function(p = 0.1, n = 10, nsim = 1000) { - nd <- rbinom(nsim, prob = p, size = n) - ll <- qbeta(p = 0.05 / 2, shape1 = nd, shape2 = n - nd + 1) - ul <- qbeta(p = 1 - 0.05 / 2, shape1 = nd + 1, shape2 = n - nd) - mean(ll < p & ul > p) -} -# Wilson (1927) -# 与 prop.test(correct = FALSE) 计算结果一致 -coverage_wilson <- function(p = 0.1, n = 10, nsim = 1000) { - phats <- rbinom(nsim, prob = p, size = n) / n - lambda <- qnorm(1 - 0.05 / 2) - ll <- phats + lambda^2 / (2 * n) - lambda * sqrt(phats * (1 - phats) / n + lambda^2 / (4 * n^2)) - ul <- phats + lambda^2 / (2 * n) + lambda * sqrt(phats * (1 - phats) / n + lambda^2 / (4 * n^2)) - mean(ll / (1 + lambda^2 / n) < p & ul / (1 + lambda^2 / n) > p) -} - -sim_dat <- transform(expand.grid( - p = seq(0.01, 0.99, by = 0.01), - n = c(10, 100), - nsim = 1000, - methods = c("Wald", "Agresti-Coull", "Wilson", "Clopper-Pearson") -), prob = ifelse(methods == "Wald", - Vectorize(coverage_wald)(p = p, n = n, nsim = nsim), - ifelse(methods == "Agresti-Coull", - Vectorize(coverage_agresti)(p = p, n = n, nsim = nsim), - ifelse(methods == "Wilson", - Vectorize(coverage_wilson)(p = p, n = n, nsim = nsim), - Vectorize(coverage_clopper)(p = p, n = n, nsim = nsim) - ) - ) -), nsample = ifelse(n == 10, "n=10", "n=100")) - -ggplot(data = sim_dat, aes(x = p, y = prob, color = nsample)) + - geom_hline(yintercept = 0.95, linetype = 2, - linewidth = 1, color = "gray60") + - geom_point() + - geom_path() + - # annotate(geom = "text", x = 0, y = 0.95, label = "0.950", - # fontface = "bold", hjust = 2, size = 3.5) + - # scale_color_grey() + - scale_color_brewer(palette = "Set1") + - facet_wrap(facets = ~methods, ncol = 1, scales = "free_y") + - labs(x = "成功概率", y = "覆盖概率", color = "样本量") + - theme_bw(base_size = 13, base_family = "sans") + - theme(title = element_text(family = "Noto Serif CJK SC")) + - coord_cartesian(clip = 'off') -``` - -通过 @fig-coverage 一看就明白了几种区间估计方法的优劣,以及为什么软件普遍默认采用 Wilson 估计方法?因为它又稳定又准确。 Wilson 区间估计用的更加广泛的,Base R 内置的比例检验函数 `prop.test()` 在不启用 Yates 修正时,就是用该方法获得比例 $p$ 的区间估计 [@Wilson1927]。Clopper-Pearson 区间估计特别适合小样本情形,它是精确区间估计方法,Base R 内置的二项比例检验函数 `binom.test()` 就是用该方法获得比例 $p$ 的区间估计[@Clopper1934]。 - -::: callout-tip -请读者再思考两个问题: @fig-coverage 为什么呈现对称的形式,泊松分布会和二项分布有类似的现象吗?如果有的话,连续分布,如正态分布和指数分布也会有吗? -::: - -## 习题 {#sec-exercise-practice} - -1. 1888 年,瑞士开始进入一个人口转变的阶段,从发展中国家的高出生率开始下滑。分析生育率和经济指标的关系。数据集 swiss 记录了 1888 年瑞士 47 个说法语的省份的生育率和社会经济指标数据。Fertility(生育率,采用常见的标准生育率统计口径)、Agriculture(男性从事农业生产的比例)、Examination(应征者在军队考试中获得最高等级的比例)、Education(应征者有小学以上教育水平的比例)、Catholic(信仰天主教的比例)、Infant.Mortality(婴儿死亡率,仅考虑出生一年内死亡),各个指标都统一标准化为百分比的形式。其中,Examination 和 Education 是 1887 年、1888 年和 1889 年的平均值。瑞士 182 个地区 1888 年及其它年份的数据可从[网站](https://opr.princeton.edu/archive/pefp/switz.aspx)获得。 - - ```{r} - #| eval: false - #| echo: false - - library(GGally) - ggpairs(swiss, columns = 1:4, aes(color = Catholic > 50), - upper = "blank", progress = FALSE) - ``` diff --git a/visualization-tikz.qmd b/visualization-tikz.qmd deleted file mode 100644 index b5696af6..00000000 --- a/visualization-tikz.qmd +++ /dev/null @@ -1,512 +0,0 @@ -# TikZ 入门 {#sec-basic-tikz} - -```{r} -#| echo: false - -source("_common.R") -``` - -有一些示意图是用来表达数据探索的思路的,而不是直接探索数据的工具。比如象限图、甘特图、思维导图、网络图等,可以用 TikZ 绘制这类图形来阐述分析维度、思路、结构等。当然,绘制这类示意图不仅限于 TikZ,还有很多其它工具,如 LaTeX 社区的 PSTricks,JavaScripts 社区的 Mermaid,软件 Graphviz 等。 - -## standalone 宏包 {#sec-tikz-standalone} - -最常见的 LaTeX 文档类有 article、report、beamer、book,分别对应文章、报告、演示和书籍。有的宏包在此基础上扩展功能,比如 ctex 宏包提供中文支持,有四个文档类 ctexart、 ctexrep 、ctexbeamer 和 ctexbook 与之对应起来。standalone 宏包提供 standalone 文类主要用于绘制独立的图片,默认情况下,文档四周多余的空白部分会被裁剪掉。在 LaTeX 环境中,推荐使用 TikZ 来绘图。standalone 文类可与 tikz 宏包一起使用,生成一张张由 TikZ 代码绘制的独立图片。下面举个简单的例子,用 TikZ 绘制两个坐标轴。 - -``` latex -\documentclass[tikz,border=1mm]{standalone} -\begin{document} -\begin{tikzpicture} -\draw[<->] (6,0) -- (0,0) node[left]{O} -- (0,6); -\end{tikzpicture} -\end{document} -``` - -standalone 文类启用 `tikz` 选项来绘图,选项 `border=1mm` 表示图片四周的边空保留 1 毫米,文档内容放在 document 环境里,TikZ 绘图代码放在 tikzpicture 环境中,命令 `\draw` 负责绘制具体的图形,用 XeLaTeX 编译,效果如 @fig-tikz 所示。 - -```{tikz} -#| label: fig-tikz -#| fig-cap: TikZ 绘图 -#| engine-opts: !expr list(classoption="tikz,border=1mm") -#| fig-width: 3 -#| fig-height: 3 -#| echo: false - -\begin{tikzpicture} -\draw[<->] (6,0) -- (0,0) node[left]{O} -- (0,6); -\end{tikzpicture} -``` - -standalone 文类有很多选项,下面介绍 4 个选项的常用内容。 - -- `class` 选项指定文类环境,默认值为 `article`,表示在 article 文类中绘图。其它选项还有 `beamer` ,表示在演示环境中绘图。在不同的文类中,图片渲染出来的效果不同。 - -- `tikz=true|false` 选项是否启用 TikZ 绘图,默认值是 `false` 。当显式地在 standalone 文类中启用 `tikz` 选项,就表示用 TikZ 绘图,将自动加载 tikz 宏包。与之类似的选项 `pstricks=true|false` ,表示是否启用 PSTricks 绘图,PSTricks 是LaTeX 社区中一套语法不同于 TikZ 的绘图工具。 - -- `crop=true|false` 选项是否裁剪变空,默认值是 `true` ,表示绘图区域以外的部分都裁剪掉。与之相关的另一个选项是 `border` ,可以更加精细地控制图片四周的各个边空。 - -- `border` 选项指定边空大小,默认值是 0,表示无边空。当 `crop=true` 时,再指定 `border` 选项,比如 `border=1mm` 表示图片四周的边空保留 1 毫米。图片四周的边空大小可以按照左、下、右、上的顺序指定,比如 `border={5mm 6mm 0mm -2mm}` 表示图片左边空 5 毫米、下边空 6 毫米、右边空 0 毫米、上边空负 2 毫米。 - -standalone 文类是支持 PSTricks 绘图的,下面在直角坐标系中绘制一个带阴影效果的圆,示例代码如下: - -``` latex -\documentclass[pstricks,border={5mm 6mm 0mm -2mm}]{standalone} -\usepackage{pst-plot} -\begin{document} -\psset{xunit=0.15in, yunit=0.15in} -\begin{pspicture}(0,0)(11,11) -\psaxes[Dx=4,Dy=4, subticks=4]{->}(0,0)(0,0)(10,10)[$x$,0][$y$,0] -\pscircle[runit=0.15in, fillcolor=orange!50, fillstyle=solid,shadow=true](5,5){3} -\end{pspicture} -\end{document} -``` - -standalone 文类的选项 `pstricks` 表示启用 PSTricks 绘图环境,加载 pst-plot 宏包提供额外的命令,PSTricks 是基于 PostScript 语言的,每一个绘图命令都是 `\ps` 开头的,比如 `\psset` 、`\psaxes`、`\pscircle` 等。`\begin{pspicture}` 和 `\end{pspicture}` 之间是 PSTricks 绘图代码,`\begin{pspicture}` 之后的 `(0,0)(11,11)` 是左下和右上角两个坐标,定义了一个绘图区域。和 TikZ 绘图代码一样,也用 XeLaTeX 编译,效果如 @fig-pstricks 所示。 - -```{tikz} -#| label: fig-pstricks -#| fig-cap: PSTricks 绘图 -#| engine-opts: !expr list(classoption="pstricks,border={5mm 6mm 0mm -2mm}",extra.preamble="\\usepackage{pst-plot}",template="code/tikz2pdf.tex") -#| fig-width: 3 -#| fig-height: 3 -#| echo: false - -\psset{xunit=0.15in, yunit=0.15in} -\begin{pspicture}(0,0)(11,11) -\psaxes[Dx=4,Dy=4, subticks=4]{->}(0,0)(0,0)(10,10)[$x$,0][$y$,0] -\pscircle[runit=0.15in, fillcolor=orange!50, fillstyle=solid,shadow=true](5,5){3} -\end{pspicture} -``` - -可以在 Quarto 和 R Markdown 文档中插入 PSTricks 绘图代码,使用 **knitr** 包的 `tikz` 引擎绘图。只要修改模版文件 `tikz2pdf.tex` ,移除一行 `\usetikzlibrary{matrix}` ,不再加载 tikz 宏包及其 matrix 库。`TIKZ_CLASSOPTION` 不再仅限于 TikZ ,而是 standalone 文类的选项,相应地,`EXTRA_TIKZ_PREAMBLE_CODE` 变成一般的 LaTeX 文档的导言区,`TIKZ_CODE` 可以是 PSTricks 代码。新的模版文件 `tikz2pdf.tex` 如下: - -``` latex -\documentclass[ -%% TIKZ_CLASSOPTION %% -]{standalone} -%% EXTRA_TIKZ_PREAMBLE_CODE %% -\begin{document} -%% TIKZ_CODE %% -\end{document} -``` - -上 @fig-pstricks 即是由 **knitr** 包的 `tikz` 引擎渲染出来的。在代码块选项 `engine-opts` 中,传递一个列表,分别包含 `classoption`(standalone 文类选项)、 `extra.preamble`(导言区)、 `template` (TikZ 模版文件)三块内容。生成 @fig-pstricks 的 `engine-opts` 设置如下: - -``` r -list( - classoption = "pstricks,border={5mm 6mm 0mm -2mm}", - extra.preamble = "\\usepackage{pst-plot}", - template = "code/tikz2pdf.tex" -) -``` - -其它选项和更多详细介绍见 standalone 宏包帮助文档。 - -## PGF 宏包 {#sec-tikz-pgf} - -PGF 宏包提供一套易于学习和使用的绘图语法 TikZ,TikZ 是 TikZ ist kein Zeichenprogramm 的简写,命名有 Linux 哲学意味。下面比较详细的介绍 LaTeX 宏包 [PGF](https://ctan.org/pkg/pgf) 绘制曲线图的过程。 - -```{tikz} -#| label: fig-tikz-pgf1 -#| engine-opts: !expr list(classoption="tikz,border=1mm") -#| fig-cap: PGF 绘制曲线图 -#| fig-width: 3 -#| fig-height: 3 - -\begin{tikzpicture} -\draw[<->] (6,0) -- (0,0) node[left]{O} -- (0,6); -\end{tikzpicture} -``` - -首先,`\draw` 命令绘制带箭头的坐标轴,坐标轴的范围 $[0,6]\times[0,6]$ 。坐标轴是由线构成的,线有虚线、实线,也有宽度和颜色,虚线还有不同类型,这些都是可以设置的参数,比如将 `\draw[<->]` 改为 `\draw[color=red,<->]` ,坐标轴颜色设置为红色。 - -```{tikz} -#| label: fig-tikz-pgf2 -#| fig-cap: PGF 绘制曲线图 -#| fig-width: 3 -#| fig-height: 3 - -\begin{tikzpicture} -\draw[<->] (6,0) node[below]{$q$} -- (0,0) node[left]{O} -- (0,6) node[left]{$V(q)$}; -\end{tikzpicture} -``` - -然后,在位置 (6,0) 和 (0,6) 分别添加节点 `node[below]{$q$}` 和 `node[left]{$V(q)$}` 。node 表示节点,节点的标签内容在大括号内,标签的位置在中括号内,这里,below 表示在位置 (6,0) 的下方。 - -```{tikz} -#| label: fig-tikz-pgf3 -#| fig-cap: PGF 绘制曲线图 -#| fig-width: 3 -#| fig-height: 3 - -\begin{tikzpicture} -\draw[<->] (6,0) node[below]{$q$} -- (0,0) node[left]{O} -- (0,6) node[left]{$V(q)$}; -\draw[very thick] (0,0) to [out=90,in=145] (5,4.5); -\end{tikzpicture} -``` - -最后,从点 (0,0) 至点 (5,4.5) 绘制一条非常粗的曲线。曲线从点 (0,0) 出去的时候,是以 90 度垂直水平轴的方向出去的,到点 (5,4.5) 是以 145 度方向进入的。角度是按照逆时针方向计算的。线的粗细、方向都是由参数决定的。 - -在这里,TikZ 是用来绘制示意图的,不需要知道每个命令的每个参数的取值有哪些。关键是知道自己想要画什么,其实,可以用铅笔在纸上以最快的方式绘制草图,了解每个绘图元素,然后查找 PGF 帮助手册,找到对应的命令和参数,将草图工整地誊抄一遍。 - -## 三维图 {#sec-tikz-pgfplots} - -顾名思义,[pgfplots](https://ctan.org/pkg/pgfplots) 宏包基于 PGF 的,用它来绘制三维图形是非常方便的。 - -``` latex -\documentclass[tikz]{standalone} -\usepackage{pgfplots} -\pgfplotsset{width=7cm,compat=1.17} -\begin{document} -%% TikZ 代码%% -\end{document} -``` - -首先加载 pgfplots 宏包,设置全局的绘图参数,`width=7cm` 表示绘图页面宽度,`compat=1.17` 表示使用 pgfplots 的版本。 - -```{tikz} -#| label: fig-tikz-viridis -#| fig-cap: TikZ 绘制三维图 viridis 调色板 -#| engine-opts: !expr list(extra.preamble=c("\\usepackage{pgfplots}","\\pgfplotsset{width=7cm,compat=1.17}")) -#| fig-width: 4 - -\begin{tikzpicture} -\begin{axis}[ - hide axis, - colormap/viridis -] -\addplot3[ - mesh, - samples=50, - domain=-8:8 -] -{ sin(deg(sqrt(x^2+y^2)))/sqrt(x^2+y^2) }; -\addlegendentry{$\frac{\sin(r)}{r}$} -\end{axis} -\end{tikzpicture} -``` - -```{tikz} -#| label: fig-tikz-jet -#| fig-cap: TikZ 绘制三维图 jet 调色板 -#| engine-opts: !expr list(extra.preamble=c("\\usepackage{pgfplots}","\\pgfplotsset{width=7cm,compat=1.17}")) -#| fig-width: 4 - -\begin{tikzpicture} -\begin{axis}[ - hide axis, - colormap/jet -] -\addplot3[ - mesh, - samples=50, - domain=-8:8 -] -{ sin(deg(sqrt(x^2+y^2)))/sqrt(x^2+y^2) }; -\addlegendentry{$\frac{\sin(r)}{r}$} -\end{axis} -\end{tikzpicture} -``` - -```{tikz} -#| label: fig-tikz-cool -#| fig-cap: TikZ 绘制三维图 cool 调色板 -#| engine-opts: !expr list(extra.preamble=c("\\usepackage{pgfplots}","\\pgfplotsset{width=7cm,compat=1.17}")) -#| fig-width: 5 - -\begin{tikzpicture} -\begin{axis}[ - hide axis, - colormap/cool, - colorbar sampled, - domain=-8:8 -] -\addplot3[ - contour filled={ - number=20, - }, - ]{sin(deg(sqrt(x^2+y^2)))/sqrt(x^2+y^2)}; -\addlegendentry{$\frac{\sin(r)}{r}$} -\end{axis} -\end{tikzpicture} -``` - -- `\begin{axis}` 和 `\end{axis}` 环境有很多配置选项,参数值 `[hide axis, colormap/viridis]` 中 `hide axis` 表示隐藏坐标轴,`colormap/viridis` 表示三维图形的调色板采用 viridis 。`colormap` 支持很多不同的调色板,上面列举了两个。其实还可以增加不同的选项,比如添加选项 `colorbar sampled` 会生成一个颜色条,还可以添加选项 `colorbar horizontal` 来水平放置颜色条。 -- 可以在导言区加载 `\usetikzlibrary{pgfplots.colorbrewer}` 导入 [ColorBrewer](https://colorbrewer2.org/) 系列调色板,方便后续绘图时调用。作用与 R 语言中的 **RColorBrewer** 包类似,调色板名称略有不同,前者 `PuBu-9` 对应后者 `PuBu` 。 -- `\addplot3` 命令绘制函数 `sin(deg(sqrt(x^2+y^2)))/sqrt(x^2+y^2)` 的三维图像,即函数 $f(x,y)=\frac{\sin(\sqrt{x^2 + y^2})}{\sqrt{x^2 + y^2}}$ 的三维图像。参数值 `[mesh, samples=50, domain=-8:8]` 中 `mesh` 表示三维图形是网格状,其它可选值还有曲面图 `surf` 、填充等值线图 `contour filled` 等,`samples=50` 表示网格密度是 50,`domain=-8:8` 表示横纵坐标的范围都是 $[-8,8]$ 。 -- `\addlegendentry` 添加图例,图例标签是 $\frac{\sin(r)}{r}$ ,颜色会随着调色板变化。 - -## 网络图 {#sec-tikz-network} - -绘制网络图用 [tikz-network](https://ctan.org/pkg/tikz-network) 宏包,也是 PGF 的一个扩展包。图结构是根据顶点和边来定义的,图的复杂程度也可以用顶点和边的规模来衡量。图描述一种非线性的关系,有自己的一套语言,定义顶点 `\Vertex` 和边 `\Edge` 的两个命令是最基础的。下面绘制柯尼斯堡七桥问题对应的图。 - -``` latex -\documentclass[tikz]{standalone} -\usepackage{tikz-network} -\begin{document} -%% TikZ 代码%% -\end{document} -``` - -```{tikz} -#| label: fig-network-seven-bridges -#| fig-cap: 柯尼斯堡七桥 -#| engine-opts: !expr list(extra.preamble=c("\\usepackage{tikz-network}")) -#| fig-width: 5 - -\begin{tikzpicture} -\Vertex[IdAsLabel, x=5, color=gray, size=1, fontsize=\large]{A} -\Vertex[IdAsLabel, x=10, color=gray, size=1, fontsize=\large]{B} -\Vertex[IdAsLabel, x=15, color=gray, size=1, fontsize=\large]{C} -\Vertex[IdAsLabel, x=10, y=6, color=gray, size=1, fontsize=\large]{D} - -\Edge[label=2, bend=45, fontscale=2](A)(B) -\Edge[label=6, bend=30, fontscale=2](A)(D) -\Edge[label=3, bend=45, fontscale=2](B)(A) -\Edge[label=5, bend=45, fontscale=2](B)(C) -\Edge[label=4, bend=45, fontscale=2](C)(B) -\Edge[label=7, bend=30, fontscale=2](D)(C) -\Edge[label=1, fontscale=2](D)(B) -\end{tikzpicture} -``` - -- `\Vertex` 命令定义顶点(含标签),参数 `IdAsLabel` 表示顶点 ID 作为标签,参数 `x` 和 `y` 表示坐标位置,参数 `color` 表示顶点的填充色,参数 `size` 表示顶点的大小,参数 `fontsize` 表示标签文本的大小。 - -- `\Edge` 命令在已有顶点的基础上定义边,`(A)(B)` 表示从顶点 A 到顶点 B 有一条边,参数`label` 表示边上的标签文本,参数 `bend` 表示边的弧度,参数 `fontscale` 表示标签文本的大小。 - -不难看出,无论是顶点还是边,都有颜色、大小、标签等参数,尽管参数名称有所不同。 - -## 思维导图 {#sec-tikz-mindmap} - -思维导图是非常常见的一种树状图,用于梳理层次关系。TikZ 绘制思维导图是通过 mindmap 库实现的,它是 PGF 的一个库。如 @fig-tikz-mindmap 所示,看着和脑神经网络有某种相似性,所以,有时候,思维导图也叫脑图。 - -``` latex -\documentclass[tikz,svgnames]{standalone} -\usepackage[fontset=fandol]{ctex} -\usetikzlibrary{mindmap} -\begin{document} -%% TikZ 代码%% -\end{document} -``` - -```{tikz} -#| label: fig-tikz-mindmap -#| fig-cap: TikZ 绘制思维导图 -#| engine-opts: !expr list(classoption="tikz,svgnames", extra.preamble=c("\\usepackage[fontset=fandol]{ctex}","\\usetikzlibrary{mindmap}")) - -\begin{tikzpicture}[ - mindmap, every node/.style=concept, concept color=orange, text=white, - level 1/.append style={level distance=5cm, sibling angle=60, font=\LARGE}, - level 2/.append style={level distance=3.5cm, sibling angle=45, font=\large} - ] - - \node{\huge{\textsf{数据分析}}} [clockwise from=60] - child [concept color=DarkMagenta] { - node {\textit{数据准备}} [clockwise from=120] - child { node {数据对象}} - child { node {数据获取}} - child { node {数据清洗}} - child { node {数据操作}} - } - child [concept color=DarkBlue] { - node {\textit{数据探索}} [clockwise from=30] - child { node {ggplot2 入门}} - child { node {基础图形}} - child { node {统计图形}} - } - child [concept color=Brown] { - node {\textit{数据交流}} [clockwise from=-30] - child { node {交互图形}} - child { node {交互表格}} - child { node {交互应用}} - } - child [concept color=teal] { - node {\textit{统计分析}} [clockwise from=-75] - child { node {统计检验}} - child { node {回归分析}} - child { node {功效分析}} - } - child [concept color=purple] { - node {\textit{数据建模}} [clockwise from=-120] - child { node {网络分析}} - child { node {文本分析}} - child { node {时序分析}} - } - child [concept color=DarkGreen] { - node {\textit{优化建模}} [clockwise from=180] - child { node {统计计算}} - child { node {数值优化}} - child { node {优化问题}} - }; -\end{tikzpicture} -``` - -根节点视为一层,则该思维导图有三层。不同的颜色和字体来区分不同的层次或分类,数据分析划分为不同的部分,每个部分有若干章。根节点字体为黑体、第二、三级节点分别为楷体、宋体。 - -``` latex -\node{\huge{\textsf{数据科学}}} [clockwise from=60] -``` - -定义根节点,节点的文本设置为黑体,大小设置为 `\huge` 。由根节点向外辐射生成 6 个子节点,每隔 60 度设置一个子节点。 - -``` latex - child [concept color=DarkMagenta] { - node {\textit{数据准备}} [clockwise from=120] - child { node {数据对象}} - child { node {数据获取}} - child { node {数据清洗}} - child { node {数据操作}} - } -``` - -第一个子节点,颜色为饱和的紫色 DarkMagenta,二级子节点为「数据准备」,三级子节点有 4 个,逆时针 120 度的位置设置第一个三级子节点「数据对象」,然后顺时针往下,依次是「数据获取」、「数据清洗」和「数据操作」。 - -## SmartArt 图 {#sec-smart-diagram} - -Office 办公软件中有一个 SmartArt 绘图模块,专门用来绘制各类示意图。LaTeX 宏包 [smartdiagram](https://ctan.org/pkg/smartdiagram) 基于 TikZ 定制了一套风格类似的绘图库。 smartdiagram 宏包的主要绘图命令是 `\smartdiagram[参数值]` ,设置不同的参数值可以绘制不同的图形,如气泡图 `bubble diagram` 和描述图 `descriptive diagram` 等。 - -```{tikz} -#| label: fig-smartdiagram-bubble -#| fig-cap: 气泡图 -#| fig-width: 4 -#| fig-height: 4 -#| engine-opts: !expr list(extra.preamble=c("\\usepackage[fontset=fandol]{ctex}","\\usepackage{smartdiagram}")) - -\smartdiagram[bubble diagram]{ - Pandoc, - 编程语言~\\ (Python\\R/Julia\\JavaScript), - 编译引擎~\\ (Jupyter\\Knitr\\Observable), - 扩展Pandoc~\\ (交叉引用\\悬浮引用\\布局面板), - 文档项目~\\ (批量渲染\\共享配置), - 扩展接口~\\ (RStudio\\VS Code\\JupyterLab) -} -``` - -```{tikz} -#| label: fig-smartdiagram-descriptive -#| fig-cap: 描述图 -#| fig-width: 4 -#| fig-height: 4 -#| engine-opts: !expr list(extra.preamble=c("\\usepackage[fontset=fandol]{ctex}","\\usepackage{smartdiagram}")) - -\smartdiagram[descriptive diagram]{ - {编程语言, {Python、R、Julia、JavaScript}}, - {编译引擎, {Jupyter、Knitr、Observable}}, - {扩展Pandoc, {交叉引用、悬浮引用、布局面板}}, - {文档项目, {批量渲染、共享配置}}, - {扩展接口, {RStudio、VS Code、JupyterLab}}, -} -``` - -## TikZ 与 R {#sec-tikz-with-r} - -TikZ 绘图的优势有很多,语法简单、易于上手、功能强大、资源丰富、成熟稳定等,可以说几乎是集所有优点于一身。正因如此,**knitr** 包和 **tikzDevice** 包将其引入 R 语言社区中。**knitr** 包的 `tikz` 引擎是用来编译 TikZ 代码的,默认使用的是 standalone 文类。 - -R 语言绘图遇到公式时,略显不足,而排版公式是 LaTeX 的优势。正因为有所不足,所以我也不会纠结于工具层面的东西,什么好用用什么!三维 @fig-tikz-viridis 是用 LaTeX 里的优秀绘图工具 TikZ 制作的,细心的读者会发现本书多次用到这个工具。 - -众所周知,Donald Knuth 十年磨一剑,开发了 TeX 排版系统,就是解决排版数学公式的痛点。如 @fig-linear-model 所示,因图形中包含数学公式和符号,为了获得原汁原味的渲染效果,在使用 Base R 绘图的过程中通过 [**tikzDevice**](https://github.com/daqana/tikzDevice) 包引入了 LaTeX 中的 TikZ 绘图引擎。 - -```{r} -#| label: fig-linear-model -#| dev: 'tikz' -#| fig-cap: "简单线性模型" -#| out-width: "60%" -#| fig-width: 3 -#| fig-height: 3 -#| fig-process: !expr to_png - -opar <- par(mgp = c(2, 0.7, 0), mar = c(4, 3, 4, 1) + 0.1, no.readonly = TRUE) -set.seed(2021) -x <- rnorm(10) -y <- x + rnorm(5, sd = 0.25) -lab <- sample( - x = paste0("$\\mathcal{", LETTERS, "}$"), - size = 10, replace = FALSE -) -model <- lm(y ~ x) -rsq <- summary(model)$r.squared -rsq <- signif(rsq, 4) -plot(x, y, - main = "你好 \\LaTeX!", # 引入 7 号文本字体 - sub = "$\\mathcal{N}(x;\\mu,\\Sigma)$", - xlab = "$x$", ylab = "$y$", type = "n" -) -text(x = x, y = y, labels = lab) -abline(model, col = "black") -# 引入 7 号数学字体 -mtext(paste("线性模型: $\\mathsf{R}^{2}=", rsq, "$"), line = 0.5) -legend("bottomright", - legend = paste0( - "$y = ", round(coef(model)[2], 3), "x +", - round(coef(model)[1], 3), "$" - ), - bty = "n" -) -on.exit(par(opar), add = TRUE) -``` - -@fig-bessel-function 是贝塞尔函数 $\mathcal{K}_{\kappa}(u)$ 在区间 $(10^{-8}, 10^2)$ 和 $(0, 4)$ 上的图像。其中,@fig-bessel-function-1 是区间 $(10^{-8}, 10^2)$ 上的贝塞尔函数 $\mathcal{K}_{\kappa}(u)$, @fig-bessel-function-2 是区间 $(0, 4)$ 上的贝塞尔函数 $\mathcal{K}_{\kappa}(u)$ 。 - -```{r} -#| label: fig-bessel-function -#| fig-cap: 贝塞尔函数图像 -#| fig-subcap: -#| - 区间 $(10^{-8}, 10^2)$ 上的贝塞尔函数 -#| - 区间 $(0, 4)$ 上的贝塞尔函数 -#| dev: 'tikz' -#| fig-process: !expr to_png -#| fig-width: 3.5 -#| fig-height: 3.5 -#| layout-ncol: 2 -#| par: true - -x0 <- 2^(-20:10) -nus <- c(2:5, 10, 20) -x <- seq(0, 4, length.out = 501) - -plot(x0, x0^-8, - frame.plot = TRUE, # 添加绘图框 - log = "xy", # x 和 y 轴都取对数尺度 - axes = FALSE, # 去掉坐标轴 - xlab = "$u$", ylab = "$\\mathcal{K}_{\\kappa}(u)$", # 设置坐标轴标签 - type = "n", # 清除绘图区域的内容 - ann = TRUE, # 添加标题 x和y轴标签 - panel.first = grid() # 添加背景参考线 -) - -axis(1, - at = 10^(-8 + 2 * 0:5), - labels = paste0("$\\mathsf{10^{", -8 + 2 * 0:5, "}}$") -) -axis(2, - at = 10^(-8 + 16 * 0:4), - labels = paste0("$\\mathsf{10^{", -8 + 16 * 0:4, "}}$"), las = 1 -) - -for (i in seq(length(nus))) { - lines(x0, besselK(x0, nu = nus[i]), col = hcl.colors(9)[i], lwd = 2) -} -legend("topright", - legend = paste0("$\\kappa=", rev(nus), "$"), - col = hcl.colors(9, rev = TRUE), lwd = 2, cex = 1 -) - -x <- seq(0, 4, length.out = 501) -x <- x[x > 0] -plot(x, x, - frame.plot = TRUE, ylim = c(1e+0, 1e+20), log = "y", - xlab = "$u$", ylab = "$\\mathcal{K}_{\\kappa}(u)$", - type = "n", yaxt = "n", ann = TRUE, panel.first = grid() -) -axis(2, - at = c(1e+0, 1e+05, 1e+10, 1e+15, 1e+20), - labels = paste0("$\\mathsf{10^{", 5 * 0:4, "}}$"), las = 1 -) - -for (i in seq(length(nus))) { - lines(x, besselK(x, nu = nus[i]), col = hcl.colors(9)[i], lwd = 2) -} -legend("topright", - legend = paste0("$\\kappa=", rev(nus), "$"), - col = hcl.colors(9, rev = TRUE), lwd = 2, cex = 1 -) -```