Area-Proportional Euler and Venn Diagrams with Circles or Ellipses

If possible, generates exactly area-proportional Euler diagrams using numerical optimization. A Euler diagram is a generalization of a Venn diagram, relaxing the criterion that all interactions need to be represented. Euler diagrams can be fit with both ellipses and circles from a wide range of inputs and can be visualized in numerous ways.


eulerr generates area-proportional euler diagrams that display set relationships (intersections, unions, and disjoints) with circles. Euler diagrams are Venn diagrams without the requirement that all set interactions be present (whether they are empty or not). That is, depending on input, eulerr will sometimes produce Venn diagrams but sometimes not.

With three or more sets intersecting, exact euler diagrams are often impossible. For such cases eulerr attempts to provide the best approximation possible by numerically tuning the circles' positions and radiuses so that the sum of squared errors is minimized.

When solutions are approximate, residuals and error statistics are provided to assess whether the resulting diagram can be trusted.

The CRAN version can be installed by running


The development version can be installed by running

sets <- c("A" = 10, "B" = 9, "C" = 4,
          "A&B" = 2, "A&C" = 3, "B&C" = 3,
          "A&B&C" = 2)
fit <- eulerr(sets)

We can inspect the solution

fit #> A           10  9.999     0.001        0.000
#> B            9  8.999     0.001        0.000
#> C            4  4.013    -0.013        0.000
#> A&B          2  2.026    -0.026        0.001
#> A&C          3  2.994     0.006        0.000
#> B&C          3  2.994     0.006        0.000
#> A&B&C        2  1.975     0.025        0.001
#> diagError:  0.001 
#> stress:     0

and plot it using plot.


Please see the introductory vignette for usage details.

eulerr is open source software, licensed under GPL-3.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

eulerr would not be possible without Ben Fredrickson's work on venn.js or Leland Wilkinson's venneuler.


eulerr 1.0.0

  • Final optimization routines have been completely rewritten in C++ using Rcpp and RcppArmadillo.
  • Switched to the cost function from EulerAPE for the default optimization target but added the posibility to choose cost function via a cost argument (currently eulerAPE or venneuler).
  • Added the option to produce conditional eulerr plots via a by argument to eulerr. The result is a list of euler diagrams that can be plotted in a grid arrangement via a new plot method.
  • Improved label placement by using a two-dimensional kernel density estimation instead of means to calculate label centers.
  • Cleaned up typos and grammar errors in the Introduction to eulerr vignette.
  • Added mar argument to plot.eulerr with a default that produces symmetric margins.
  • Corrected the implementation of the stress statistic from venneuler.
  • Switched to Vogel sampling to generate points to choose label positions from.
  • Minor clean up and performance fixes all around.
  • Added a print.eulerr method.
  • Updated vignette to cover new features and changes.

eulerr 0.1.0

  • The first release.

Reference manual

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


3.0.1 by Johan Larsson, 6 days ago

Report a bug at

Browse source code at

Authors: Johan Larsson [aut, cre], A. Jonathan R. Godfrey [ctb]

Documentation:   PDF Manual  

GPL-3 license

Imports graphics, grDevices, grid, stats, utils, lattice, Rcpp, GenSA

Suggests knitr, testthat

Linking to Rcpp, RcppArmadillo

See at CRAN