ggellipse: returns a ggplot with ellipses drawn using specified...

Description Usage Arguments Value Examples

View source: R/misc_helpers.R

Description

uses eulerr's non-exported ellipse drawing coordinate function

Usage

1
2
3
4
ggellipse(xcentres, ycentres, r, r2 = r, phi = rep(0,
  length(xcentres)), circle_colors = NULL,
  group_names = LETTERS[seq_along(xcentres)], line_alpha = 1,
  fill_alpha = 0.3, line_width = 2, n_points = 200)

Arguments

xcentres

numeric x-coord of centers of ellipses

ycentres

numeric y-coord of centers of ellipses, must have same length as xcentres

r

numeric radius1 of ellipse, must have length of 1 or match length of xcentres

r2

numeric radius2 of ellipse, must have length of 1 or match length of xcentres. same as r by default.

phi

numeric phi of ellipse, must have length of 1 or match length of xcentres. 0 by default.

circle_colors

character of rcolors or hex colors or NULL. if null safeBrew of Dark2 is used

group_names

character/factor names of color/fill groups. capital letters by default.

line_alpha

numeric [0,1] alpha of lines, 1 by default

fill_alpha

numeric [0,1] alpha of fill, .3 by default.

line_width

numeric > 0. passed to size. 2 by default

n_points

integer > 1. number of points to approximate circle with. 200 by default

Value

a ggplot containing ellipses

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
ggellipse(xcentres = c(1, 1, 2),
    ycentres = c(2, 1, 1),
    r = c(1, 2, 1))
ggellipse(xcentres = c(1, 1, 2),
    ycentres = c(2, 1, 1),
    r = c(1, 2, 1),
    fill_alpha = 0,
    group_names = paste("set", 1:3))
ggellipse(xcentres = c(1, 1, 2),
    ycentres = c(2, 1, 1),
    r = c(1, 2, 1),
    circle_colors = c("red", "orange", "yellow"),
    line_alpha = 0,
    group_names = paste("set", 1:3))

jrboyd/seqsetvis documentation built on Oct. 14, 2018, 3:04 p.m.