{"id":13711637,"url":"https://github.com/nevrome/ggpointgrid","last_synced_at":"2025-09-23T07:31:13.911Z","repository":{"id":95148415,"uuid":"308971148","full_name":"nevrome/ggpointgrid","owner":"nevrome","description":"R Package - Rearrange scatter plot points on a regular grid","archived":false,"fork":false,"pushed_at":"2025-09-03T16:10:14.000Z","size":520,"stargazers_count":39,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-03T16:28:03.738Z","etag":null,"topics":["ggplot2","plotting","r"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nevrome.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-10-31T21:00:58.000Z","updated_at":"2025-08-31T21:12:05.000Z","dependencies_parsed_at":"2024-01-17T16:58:59.380Z","dependency_job_id":"7dd3aacf-9f06-4124-be74-f3b44393409f","html_url":"https://github.com/nevrome/ggpointgrid","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nevrome/ggpointgrid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nevrome%2Fggpointgrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nevrome%2Fggpointgrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nevrome%2Fggpointgrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nevrome%2Fggpointgrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nevrome","download_url":"https://codeload.github.com/nevrome/ggpointgrid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nevrome%2Fggpointgrid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276537737,"owners_count":25659929,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ggplot2","plotting","r"],"created_at":"2024-08-02T23:01:10.189Z","updated_at":"2025-09-23T07:31:13.904Z","avatar_url":"https://github.com/nevrome.png","language":"R","funding_links":[],"categories":["Plot layers","R"],"sub_categories":[],"readme":"---\noutput: github_document\neditor_options: \n  chunk_output_type: console\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n# ggpointgrid\n\nThis package provides geoms to rearrange scatter-plot coordinates on regular grids while strictly avoiding over-plotting. The applications are similar to `geom_jitter`.\n\n### Installation\n\nYou can install the development version from github with the following command (in your R console):\n\n```\nif(!require('remotes')) install.packages('remotes')\nremotes::install_github(\"nevrome/ggpointgrid\")\n```\n\nWindows users will need the [Rtools](https://cran.r-project.org/bin/windows/Rtools/) to build the package.\n\n### Examples\n\n#### `geom_pointgrid`\n\n`geom_pointgrid` aims to optimize the arrangement of observations on a regular grid. This works well for figures with continuously scaled x- and y-axes, so for scatter-plots or even map plots. Just as in `geom_jitter` the rearrangement of the points reduces accuracy and precision of positional information on x and y in favour of making **every** observation visible.\n\nThe grid properties are controlled with the parameters `grid_x` and `grid_y`, which allow to precisely specify the desired graticules.\n\n```{r, warning=FALSE}\nlibrary(ggplot2)\nset.seed(5)\n\ndf \u003c- tibble::tibble(\n  x = rep(c(1,1,2,3,3), times = 10),\n  y = rep(c(1,3,2,1,3), times = 10),\n  var = sample(c(\"A\", \"B\", \"C\"), size = 50, replace = T)\n)\n\ncoord \u003c- coord_fixed(xlim = c(0.5,3.5), ylim = c(0.5,3.5))\n\np1 \u003c- ggplot(df) +\n  geom_point(aes(x, y, color = var)) +\n  coord + ggtitle(\"geom_point\")\n\np2 \u003c- ggplot(df) +\n  geom_jitter(aes(x, y, color = var), width = 0.3, height = 0.3) +\n  coord + ggtitle(\"geom_jitter\")\n\np3 \u003c- ggplot(df) +\n  ggpointgrid::geom_pointgrid(aes(x, y, color = var), grid_x = 15, grid_y = 15) +\n  coord + ggtitle(\"geom_pointgrid\")\n\np4 \u003c- ggplot(df) +\n  ggpointgrid::geom_pointgrid(\n    aes(x, y, color = var),\n    grid_x = seq(min(df$x) - 0.3, max(df$x) + 0.3, length.out = 18),\n    grid_y = seq(min(df$y) - 0.3, max(df$y) + 0.3, length.out = 18)\n  ) +\n  coord + ggtitle(\"geom_pointgrid, grid specified\")\n\ncowplot::plot_grid(p1, p2, p3, p4)\n```\n\n`geom_textgrid` performs the same arrangement operation on text data. It is to `geom_text` what `geom_pointgrid` is to `geom_point`.\n\n#### `geom_pointrect`\n\n`geom_pointrect` was designed for a slightly different use-case than `geom_pointgrid`. Here all observations that share the x- and y-coordinate are spread out into a rectangular grid, representing only this one position. This is especially useful, when the x- and y- axis are ordinally scaled.\n\nThe order within each rectangle can be set by the order of the input data.frame and the arguments `scale_x` and `scale_y` control the size of the per-position box. The arguments `round_x` and `round_y` allow to specify how data on continuously scaled x- and y-axes should be aggregated.\n\n```{r, warning=FALSE}\ndf \u003c- tibble::tibble(\n  x = rep(letters[c(1,1,2,3,3)], times = 10),\n  y = rep(letters[c(1,3,2,1,3)], times = 10),\n  var = sample(c(\"A\", \"B\", \"C\"), size = 50, replace = T)\n) |\u003e dplyr::arrange(var)\n\ncoord \u003c- coord_fixed()\n\np4 \u003c- ggplot(df) +\n  geom_point(aes(x, y, color = var)) +\n  coord + ggtitle(\"geom_point\")\n\np5 \u003c- ggplot(df) +\n  geom_jitter(aes(x, y, color = var), width = 0.3, height = 0.3) +\n  coord + ggtitle(\"geom_jitter\")\n\np6 \u003c- ggplot(df) +\n  ggpointgrid::geom_pointrect(aes(x, y, color = var)) +\n  coord + ggtitle(\"geom_pointrect\")\n\np7 \u003c- ggplot(df) +\n  ggpointgrid::geom_pointrect(\n    aes(x, y, color = var),\n    scale_x = 0.2,\n    scale_y = 0.2\n  ) +\n  coord + ggtitle(\"geom_pointrect, scaling set\")\n\ncowplot::plot_grid(p4, p5, p6, p7)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnevrome%2Fggpointgrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnevrome%2Fggpointgrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnevrome%2Fggpointgrid/lists"}