Accelerating 'ggplot2'

The aim of 'ggplot2' is to aid in visual data investigations. This focus has led to a lack of facilities for composing specialised plots. 'ggforce' aims to be a collection of mainly new stats and geoms that fills this gap. All additional functionality is aimed to come through the official extension system so using 'ggforce' should be a stable experience.

Accelerating ggplot2

Travis-CI Build Status AppVeyor Build Status CRAN_Release_Badge CRAN_Download_Badge


ggforce is a package aimed at providing missing functionality to ggplot2 through the extension system introduced with ggplot2 v2.0.0. Broadly speaking ggplot2 has been aimed primarily at explorative data visualization in order to investigate the data at hand, and less at providing utilities for composing custom plots a la D3.js. ggforce is mainly an attempt to address these "shortcomming" (design choices might be a better description). The goal is to provide a repository of geoms, stats, etc. that are as well documented and implemented as the official ones found in ggplot2.


The inclusion of any geom, stat, position etc in ggforce is not necessarily a recommendation of their use. ggplot2 has been succesfull in being opinionated about what functionality should be available. This is good as it insulates the user from making bad decisions when analyzing their data (to a certain degree), but it also makes it difficult to develop novel visualizations using the ggplot2 API. ggforce on the other hand positions itself closer to the "anything goes - the user is responsible for the quality of the output". Be very aware of this responsibility! Bad visualizations lie about, distorts, and obscurify the data behind them, both to you and the ones you share your visualizations with.


ggforce is available on CRAN and can be installed in the regular way:


It is very possible that the GitHub repository contains new experimental features not released on CRAN yet. To get a taste of the future use devtools to install the development version:

if (!require(devtools)) {


ggforce is by design a collection of features with the only commonality being their tie to the ggplot2 API. Because of this an overview of all features would get too long for a README. The package does contain a vignette where every feature is described and justified with examples and plots. There should be a plot in the README of a visualization package though, so without further ado:

ggplot(iris, aes(Petal.Length, Petal.Width, colour = Species)) +
    geom_point() +
    facet_zoom(x = Species == "versicolor")



Pull and feature requests are very welcome. Obviously PR's will lead to faster implementations than feature requests. I would like to urge requests to include the following if possible:

Pull requests

If a PR is for a new feature, it should be self contained, possibly using already implemented functionality if applicable. All exported functions should be documented following the style from ggplot2 using roxygen2 comment. You can credit yourself with the implementation in the documentation. If the feature concerns a visualization appraoch invented by others, please link to the article describing the approach.

Feature requests

If a feature is wished, but skill, time or other is lacking to create a full PR, please file an issue. The feature request should provide a detailed description of the nature of the feature, with links to relevant litterature describing the visualization type, as well as possible use cases to guide in designing the use cases.


For an overview of already requested features, enhancements, and bug fixes please consult the issues list. I will try to keep the labels up to date so it should be easy to identify whether an issue is related to any of the above.

Related projects

ggforce is by no means unique. The ggplot2 ecosystem is flourishing following the release of v2.0.0. To help keep on top of all ggplot2 extension packages a web page has been created where developers can submit their packages. Please explore to get an overview of the current state of ggplot2 extensions.


ggforce 0.1.1

New features

  • Zoom indicator styling can now be specified separetely for x and y zoom using zoom.x and zoom.y in theme (inherits from zoom that inherits from strip.background)

Bug fixes

  • Fix bug in facet_wrap_paginate that threw errors when using it with free scales (#19)
  • Fixes bug in facet_zoom where y-axis would be incorrectly displayed when zooming on both axes without splitting the view (#23)
  • Fixes bug in facet_zoom where scale expansion where not taken into account when drawing the indicator area (#22)
  • Fixes a bug in facet_zoom that would throw errors with layers not containing the column that is zoomed by (#21)

ggforce 0.1.0

Major changes

  • geom_edge_bundle has been renamed geom_bspline and lost the tension argument. True edge bundle functionality has been moved to ggraph

New features

  • geom_bezier for drawing quadratic and cubic beziers
  • geom_link for augmented segment/path drawing
  • geom_sina as an alternative to geom_violin and geom_beeswarm
  • scale_[x|y]_unit for using units vectors
  • facet_[wrap|grid]_paginate to split facetting into multiple pages
  • facet_zoom for contextual zooming

ggforce 0.0.1

Major changes

  • First commit

New features

  • geom_arc / stat_arc for drawing circle segments
  • geom_edge_bundle / stat_edge_bundle for drawing edge bundles based on control points
  • geom_arc_bar /stat_arc_bar / stat_pie for drawing arcs and wedges with fill
  • geom_circle / stat_circle for drawing circles with radius based on coordinate system scale
  • power_trans for creating power transformations
  • radial_trans for creating transformation between radial and cartesian coordinates
  • trans_reverser for reversing a trans object

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.1.3 by Thomas Lin Pedersen, 7 months ago

Browse source code at

Authors: Thomas Lin Pedersen

Documentation:   PDF Manual  

GPL (>= 2) license

Imports Rcpp, grid, dplyr, scales, MASS, tweenr, units, gtable, lazyeval

Depends on ggplot2

Suggests knitr, rmarkdown, devtools

Linking to Rcpp

Imported by GGEBiplots, circumplex, dabestr, ggdag, ggiraphExtra, ggraph, helixvis, plinkQC, rusk, scatterpie.

Suggested by ensr, units.

See at CRAN