{"id":21427046,"url":"https://github.com/japhir/geologictimescale","last_synced_at":"2026-01-25T00:02:29.738Z","repository":{"id":48140041,"uuid":"174203035","full_name":"japhir/GeologicTimeScale","owner":"japhir","description":"Read in the GTS as a csv, then use ggplot2 in R to make a timescale. Use patchwork to add it to your figures.","archived":false,"fork":false,"pushed_at":"2022-07-22T08:10:48.000Z","size":819,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T18:22:03.586Z","etag":null,"topics":["geology","ggplot2","r","time","timescale"],"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/japhir.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-06T18:58:56.000Z","updated_at":"2024-10-20T06:59:43.000Z","dependencies_parsed_at":"2022-09-05T09:50:57.123Z","dependency_job_id":null,"html_url":"https://github.com/japhir/GeologicTimeScale","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/japhir/GeologicTimeScale","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/japhir%2FGeologicTimeScale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/japhir%2FGeologicTimeScale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/japhir%2FGeologicTimeScale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/japhir%2FGeologicTimeScale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/japhir","download_url":"https://codeload.github.com/japhir/GeologicTimeScale/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/japhir%2FGeologicTimeScale/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28739321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T22:12:27.248Z","status":"ssl_error","status_checked_at":"2026-01-24T22:12:10.529Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["geology","ggplot2","r","time","timescale"],"created_at":"2024-11-22T21:43:46.021Z","updated_at":"2026-01-25T00:02:29.720Z","avatar_url":"https://github.com/japhir.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+title: Make a nice Geologic Time Scale\n#+property: header-args:R  :session *R:GTS* :exports both :results output :eval no-export\n\nIn this repository I create a nice PDF on A3 size to print the Geologic Time Scale on a linear scale, so that it doesn't seem like the recent time periods took the same amount of time as the Precambrian.\n\nI had to copy over all the colours and age ranges, because the official tools only provide a PDF.\n\nIf you want to use this figure for your own plots you can either:\n\n1. load in the ~GTS_widths.csv~ file and plot it yourself\n   #+begin_src R\n     library(readr)\n     GTS \u003c- read_csv(\"https://github.com/japhir/GeologicTimeScale/raw/master/GTS_widths.csv\")\n     # create plot yourself\n   #+end_src\n\n2. load in the ~gts_plot.rds~ file and tweak the plot itself.\n   #+begin_src R\n     library(ggplot2)\n     library(readr)\n     gts \u003c- read_rds(\"https://github.com/japhir/GeologicTimeScale/raw/master/out/gts_plot.rds\")\n   #+end_src\n\nI prefer to read in the data, filter out what I want (e.g., only Epochs), then make the plot full-sized and add it to the data with [[https://patchwork.data-imaginist.com/][patchwork]].\n\n*NOTE: it's probably much better to use a full-fledged package to add the Geologic Time Scale to your plots, e.g. using the [[https://github.com/willgearty/deeptime/][deeptime]] package!*\n\n* full workflow\nload libraries\n#+begin_src R\n  library(dplyr)\n  library(ggplot2)\n  library(readr)\n#+end_src\n\nRead in my weird data frame\n#+begin_src R\n  GTS \u003c- read_csv(\"https://github.com/japhir/GeologicTimeScale/raw/master/GTS_widths.csv\")\n#+end_src\n\nCreate plot of \"data\"\n#+begin_src R :results output graphics file :file imgs/iris.png :width 800 :height 500\n  dataplot \u003c- iris |\u003e\n    # create fake ages\n    mutate(age = rep(seq(0, 44, length.out = 50), 3)) |\u003e\n    ggplot(aes(x = age, y = Petal.Length, colour = Species)) +\n    geom_point() +\n    geom_line()\n  dataplot\n#+end_src\n\n#+RESULTS:\n\n[[file:imgs/iris.png]]\n\nNow create the desired subset of the GTS plot\n#+begin_src R :results output graphics file :file imgs/gts_data.png :width 800 :height 80\n  gtsplot \u003c- GTS |\u003e\n    # subset it to only show Periods\n    filter(type == \"Period\") |\u003e\n    # filter to our time range\n    filter(top \u003c 55) |\u003e\n    # rectangles for each period\n    ggplot() +\n    geom_rect(aes(ymin = start, ymax = end, xmin = top, xmax = bot, fill = col),\n              show.legend = FALSE, col = \"black\") +\n    # make sure that the fill colour is given by our hex colours\n    scale_fill_identity() +\n    # add period names\n    geom_text(aes(x = meanage, y = meanwidth, label = name, size = fontsize * .5,\n                  ## angle = fontangle,\n                  col = fontcolor, fontface = fontface)) +\n    # make sure the font size is set to your liking\n    scale_size_identity() +\n    scale_colour_identity() +\n    # add axis label for age axis\n    labs(x = \"Age (millions of years ago)\") +\n    theme(\n      # remove gray panel\n      panel.grid = element_blank(),\n      panel.background = element_blank(),\n      # remove y axis entirely\n      axis.line.y = element_blank(),\n      axis.title.y = element_blank(),\n      axis.text.y = element_blank(),\n      axis.ticks.y = element_blank()) +\n    coord_cartesian(xlim = c(0, 40))\n  gtsplot\n#+end_src\n\n#+RESULTS:\n\n[[file:imgs/gts_data.png]]\n\nAnd to combine the two, make sure they have precisely the same x axis and then join them together using patchwork.\n\n#+begin_src R :results output graphics file :file imgs/gts_plus_data.png :width 800 :height 800\n  library(patchwork)\n  (dataplot +\n   # make sure that it has precisely the same x axis range\n   coord_cartesian(xlim = c(0, 40)) +\n   # then remove the redundant x-axis from the data\n   theme(axis.text.x = element_blank(), axis.title.x = element_blank())) /\n    # and add the gts beneath the data, at a smaller size\n    gtsplot + plot_layout(heights = c(1, .05))\n#+end_src\n\n#+RESULTS:\n\n[[file:imgs/gts_plus_data.png]]\n\n* contributing\n\nIf you spot any errors, please feel free to file an issue or write a pull request!\n\n* copying\n\nI've licensed the code with GPL-3, but the underlying data is copyright of the Geologic Time Scale at https://timescalefoundation.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaphir%2Fgeologictimescale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaphir%2Fgeologictimescale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaphir%2Fgeologictimescale/lists"}