{"id":13423670,"url":"https://github.com/r-lib/ragg","last_synced_at":"2026-04-08T08:01:00.990Z","repository":{"id":43408533,"uuid":"175796504","full_name":"r-lib/ragg","owner":"r-lib","description":"Graphic Devices Based on AGG","archived":false,"fork":false,"pushed_at":"2026-03-13T13:17:18.000Z","size":195383,"stargazers_count":181,"open_issues_count":7,"forks_count":30,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-04-01T16:30:33.864Z","etag":null,"topics":["drawing","graphics","rstats","vector-graphics"],"latest_commit_sha":null,"homepage":"https://ragg.r-lib.org","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-lib.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-03-15T10:11:11.000Z","updated_at":"2026-03-13T13:08:46.000Z","dependencies_parsed_at":"2023-02-15T04:00:56.575Z","dependency_job_id":"72cafe5f-248c-4863-859c-8507c2820292","html_url":"https://github.com/r-lib/ragg","commit_stats":{"total_commits":399,"total_committers":12,"mean_commits":33.25,"dds":0.06766917293233088,"last_synced_commit":"9cb92fd2d7b8621878cc8b97a9507491caf03b8d"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/r-lib/ragg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fragg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fragg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fragg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fragg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-lib","download_url":"https://codeload.github.com/r-lib/ragg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fragg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31545906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"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":["drawing","graphics","rstats","vector-graphics"],"created_at":"2024-07-31T00:00:40.277Z","updated_at":"2026-04-08T08:01:00.951Z","avatar_url":"https://github.com/r-lib.png","language":"C++","funding_links":[],"categories":["C++","ggplot"],"sub_categories":["Devices"],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n# ragg \u003ca href='https://ragg.r-lib.org'\u003e\u003cimg src='man/figures/logo.png' align=\"right\" height=\"131.5\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/r-lib/ragg/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/ragg/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/r-lib/ragg/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/ragg?branch=main)\n[![CRAN status](https://www.r-pkg.org/badges/version/ragg)](https://cran.r-project.org/package=ragg)\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n[![Codecov test coverage](https://codecov.io/gh/r-lib/ragg/graph/badge.svg)](https://app.codecov.io/gh/r-lib/ragg)\n\u003c!-- badges: end --\u003e\n\nThis package provides graphic devices for R based on the AGG library developed\nby the late Maxim Shemanarev. AGG provides both higher performance and higher\nquality than the standard raster devices provided by grDevices. For a comparison\nwith the default devices, see the\n[performance](https://ragg.r-lib.org/articles/ragg_performance.html) and\n[quality](https://ragg.r-lib.org/articles/ragg_quality.html) vignettes.\n\n## Installation\nThe package can be installed from CRAN with `install.packages('ragg')` or, if \nthe development version is desired, directly from github:\n\n```{r, eval=FALSE}\n# install.packages('pak')\npak::pak('r-lib/ragg')\n```\n\n## Use\nragg provides drop-in replacements for the png, jpeg, and tiff graphic devices\nprovided by default from the grDevices packages and can both produce png, jpeg \nand tiff files. Notable features, that sets itself apart from the build-in\ndevices, includes:\n\n- Faster (up to 40% faster than anti-aliased cairo device)\n- Direct access to all system fonts\n- Advanced text rendering, including support for right-to-left text, emojis, and\n  font fallback\n- High quality anti-aliasing\n- High quality rotated text\n- Support 16-bit output\n- System independent rendering (output from Mac, Windows, and Linux should be\n  identical)\n\nYou can use it like any other device. The main functions are `agg_png()`,\n`agg_jpeg()` and `agg_tiff()`, all of which have arguments that closely match \nthose of the `png()`, `jpeg()` and `tiff()` functions, so switching over should \nbe easy.\n\n```{r, fig.alt=\"A scatterplot created with ggplot2 using a fancy non-standard font and mixing in emojis with text\"}\nlibrary(ragg)\nlibrary(ggplot2)\n\nfile \u003c- knitr::fig_path('.png')\n\non_linux \u003c- tolower(Sys.info()[['sysname']]) == 'linux'\nfancy_font \u003c- if (on_linux) 'URW Chancery L' else 'Papyrus'\n\nagg_png(file, width = 1000, height = 500, res = 144)\nggplot(mtcars) + \n  geom_point(aes(mpg, disp, colour = hp)) + \n  labs(title = 'System fonts — Oh My! 😱') + \n  theme(text = element_text(family = fancy_font))\ninvisible(dev.off())\n\nknitr::include_graphics(file)\n```\n\nFurther, it provides an `agg_capture()` device that lets you access the device\nbuffer directly from your R session.\n\n```{r, fig.asp=0.5, out.width=\"70%\", out.extra='style=\"margin-left: 15%;\"', fig.alt=\"A very simple scatterplot captured as raster data and then drawn again\"}\ncap \u003c- agg_capture(width = 1000, height = 500, res = 144)\nplot(1:10, 1:10)\n\nscatter \u003c- cap()\ninvisible(dev.off())\n\n# Remove margins from raster plotting\npar(mai = c(0, 0, 0, 0))\nplot(as.raster(scatter))\n```\n\n### Use ragg with knitr\nknitr supports png output from ragg by setting `dev = \"ragg_png\"` in the chunk\nsettings or globally with `knitr::opts_chunk$set(dev = \"ragg_png\")`.\n\n### Use ragg in RStudio\nragg can be used as the graphic back-end to the RStudio device \n(for RStudio \u003e= 1.4) by choosing *AGG* as the backend in the graphics pane in \ngeneral options (see screenshot)\n\n```{r, echo=FALSE, fig.cap=\"Setting ragg as backend in RStudio\", fig.alt=\"A screenshot showing the RStudio Global Options window with focus on the General pane and the Graphics tab. Here it shows AGG is selected as Backend in order to tell RStudio to use ragg\"}\nknitr::include_graphics(\"https://i.imgur.com/4XgiPWy.png\") \n```\n\n## Code of Conduct\nPlease note that the 'ragg' project is released with a\n[Contributor Code of Conduct](https://ragg.r-lib.org/CODE_OF_CONDUCT.html).\nBy contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fragg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-lib%2Fragg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fragg/lists"}