How do you create custom geoms in ggplot2? | Gina Reynolds | Data Science Lab

Posit PBC
1,236 views •

You can define a ggproto class object! Just like you can create an R package with custom functions, you can create an R package with custom geoms! The starter recipes in this lab will help you get started on your own custom ggplot2-compatible functions. The Data Science Lab is a live weekly call. Register at pos.it/dslab! Discord invites go out each week on lives calls. We'd love to have you! It's is an open, messy space for learning and asking questions. Think of it like pair coding with a friend or two. Learn something new, and share what you know to help others grow. On this call, Gina Reynolds talks about ggplot2 extension generally, and works through a 'layer' extension with Isabella - that is, a user-facing functions with the stat_ or geom_ prefixes. Hosting crew from Posit: Libby Heeren, Isabella Velasquez Gina Reynolds's socials and urls: ggplot2 Extenders website: https://ggplot2-extenders.github.io/ggplot-extension-club/ Gina's Bluesky: https://bsky.app/profile/ginareynolds.bsky.social Gina's GitHub: https://github.com/evamaerey Gina's LinkedIn: https://www.linkedin.com/in/evangeline-reynolds/ Resources mentioned in video and/or the chat: geofacet package: https://hafen.github.io/geofacet/ Andrew Heiss on ggplot and geographic maps: https://www.andrewheiss.com/blog/2025/02/19/ggplot-histogram-legend/ Slidecrafting book (Quarto reveal.js presentations): https://slidecrafting-book.com/ Slidecrafting Workshop with Emil Hvitfeldt: https://pos.it/slide-wrkshp ggplot2 extenders group join form: http://bit.ly/join-gg-extenders ggplot2 extenders website: https://ggplot2-extenders.github.io/ggplot-extension-club/ ggplot2 easy geom recipes: https://evamaerey.github.io/easy-geom-recipes/ geom_means recipe: https://evamaerey.github.io/easy-geom-recipes/recipe1means.html Easy geom recipes evaluation report: https://evamaerey.github.io/evamaerey/report2_easy_geom_recipes.pdf Plotnine easy geom recipes: https://has2k1.github.io/easy-geom-recipes/ Getting started with geomtextpath (Libby's blog post): https://rfortherestofus.com/2024/01/get-started-geomtextpath cli package GitHub: https://github.com/r-lib/cli/ beepr package GitHub: https://github.com/rasmusab/beepr ggplot2 stat_summary() documentation: https://ggplot2.tidyverse.org/reference/stat_summary.html ggh4x package: https://teunbrand.github.io/ggh4x/ legendry package: https://teunbrand.github.io/legendry/ ThemePark package GitHub: https://github.com/MatthewBJane/ThemePark ggfittext package: https://wilkox.org/ggfittext/ ggfx package: https://ggfx.data-imaginist.com/ ggridges package introduction: https://wilkelab.org/ggridges/articles/introduction.html ggbump package GitHub: https://github.com/davidsjoberg/ggbump geomtextpath package: https://allancameron.github.io/geomtextpath/ ggpubr package: https://rpkgs.datanovia.com/ggpubr/ plotnine: https://plotnine.org/

Keyboard shortcuts

On. Switch them off if they collide with your assistive tools; ? still opens this sheet.

Go to

Press g then the letter.

  • gh Latest
  • gs Sources
  • gm Media
  • gv Videos
  • gp Podcasts
  • gc Calendar
  • gd Decoder
  • gz Dataviz
  • ga Datasets
  • gb Blog
  • gk Markets
  • gj Careers
  • gn Prompt Notebook

On this page

  • / Focus search, where there is one
  • t Back to top
  • ? This list
  • Esc Close