triplot: Triangle Plots

Description Usage Format Examples

Description

Triangle Plots

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
StatTriangle

stat_triangle(mapping = NULL, data = NULL, geom = "point",
  position = "identity", show.legend = NA, inherit.aes = TRUE, ...)

tri_grid(colour = color, color = "gray70", grid_lines = 5,
  labels = c("alpha[1]", "alpha[2]", "alpha[3]"), ...)

tri_labels(labels = c("alpha[1]", "alpha[2]", "alpha[3]"),
  parse = TRUE, colour = color, color = "gray60", size = 4,
  padding = 0.1, ...)

geom_tripoint(..., stat = "triangle")

geom_triline(..., stat = "triangle")

geom_tripath(..., stat = "triangle")

Format

An object of class StatTriangle (inherits from Stat, ggproto, gg) of length 3.

Examples

1
2
3
4
5
6
7
ddd <- data_frame( x=c(1, 0, .5, .25, 0), y = c(0, .2, .2, .25, .8)) %>% mutate(z = 1 - x - y)
ggplot()  +
  tri_theme() +
  tri_grid(colour="red") +
  tri_labels(size=10, padding=.05) +
  geom_path(data=ddd, aes(x=x, y=y, z=z), stat="triangle", size=2, alpha=.3) +
  geom_point(data=ddd, aes(x=x, y=y, z=z), stat="triangle", size=3, alpha=.6, colour="navy")

EconModels/MacroGrowth documentation built on Dec. 17, 2019, 10:41 p.m.