Learn R Programming

⚠️There's a newer version (0.4.2) of this package.Take me there.

ggforce

Accelerating ggplot2

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 “shortcomings” (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.

Installation

You can install the released version of ggforce from CRAN with:

install.packages("ggforce")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("thomasp85/ggforce")

Features

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 has a website 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:

library(ggforce)
#> Loading required package: ggplot2
ggplot(iris, aes(Petal.Length, Petal.Width, colour = Species)) +
  geom_point() +
  facet_zoom(x = Species == "versicolor")

Code of Conduct

Please note that the ‘ggforce’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Install

install.packages('ggforce')

Monthly Downloads

82,881

Version

0.4.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

October 4th, 2022

Functions in ggforce (0.4.1)

facet_matrix

Facet by different data columns
geom_autodensity

A distribution geoms that fills the panel and works with discrete and continuous data
facet_zoom

Facet data for zoom with context
geom_autopoint

A point geom specialised for scatterplot matrices
geom_diagonal_wide

Draw an area defined by an upper and lower diagonal
geom_bspline_closed

Create closed b-spline shapes
geom_link

Link points with paths
geom_bspline

B-splines based on control points
geom_ellipse

Draw (super)ellipses based on the coordinate system scale
geom_diagonal

Draw horizontal diagonals
geom_bezier

Create quadratic or cubic bezier curves
geom_circle

Circles based on center and radius
geom_voronoi

Voronoi tesselation and delaunay triangulation
geom_mark_ellipse

Annotate areas with ellipses
geom_shape

Draw polygons with expansion/contraction and/or rounded corners
geom_regon

Draw regular polygons by specifying number of sides
geom_spiro

Draw spirograms based on the radii of the different "wheels" involved
GeomShape

ggforce extensions to ggplot2
geom_sina

Sina plot
geom_mark_circle

Annotate areas with circles
geom_parallel_sets

Create Parallel Sets diagrams
geom_mark_rect

Annotate areas with rectangles
geom_mark_hull

Annotate areas with hulls
linear_trans

Create a custom linear transformation
label_tex

A labeller function to parse TeX syntax
position_auto

Jitter based on scale types
radial_trans

Create radial data in a cartesian coordinate system
scale_depth

Scales for depth perception
n_pages

Determine the number of pages in a paginated facet plot
ggforce-package

ggforce: Accelerating 'ggplot2'
interpolateDataFrame

Interpolate layer data
theme_no_axes

Theme without axes and gridlines
trans_reverser

Reverse a transformation
stat_err

Intervals in vertical and horizontal directions
position_jitternormal

Jitter points with normally distributed random noise
scale_unit

Position scales for units data
power_trans

Create a power transformation object
facet_grid_paginate

Split facet_grid over multiple plots
facet_stereo

Create a stereogram plot
facet_row

One-dimensional facets
geom_arc_bar

Arcs and wedges as polygons
facet_wrap_paginate

Split facet_wrap over multiple plots
gather_set_data

Tidy data for use with geom_parallel_sets
geom_arc

Arcs based on radius and radians