PlotMandala: Plot Mandala

Description Usage Arguments Details Value Author(s) References Examples

View source: R/PlotMandala.R

Description

Draw a colored mandala using Voronoi tessellation and a Wes Anderson color palette.

Usage

1
2
3
4
5
6
7
8
PlotMandala(
  radius = c(1.1, 1.8),
  npoints = 14L,
  depth = 3L,
  scheme = NULL,
  mar = c(0, 0, 0, 0),
  seed = NULL
)

Arguments

radius

'numeric' vector of length 1 or 2. Factor of expansion or compression. A random-number generator may be used by defining the lower and upper limits of a uniform distribution.

npoints

'integer' vector. Number of points is randomly selected from this argument.

depth

'integer' vector. Number of iterations is randomly selected from this argument.

scheme

'character' vector. Name of color palette(s) to choose from, see wes_palette function for choices. By default, specified using a random selection from all possible palettes.

mar

'numeric' vector of length 4. Number of lines of margin to be specified on the bottom, left, top, and right side of the plot.

seed

'integer' count. Random number generator state, used to replicate the mandala.

Details

Value

Invisible NULL

Author(s)

J.C. Fisher

References

This function was derived from the mandalas-colored R script by A.S. Chinchón, accessed on Dec 13, 2019.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
meditate::PlotMandala()

## Not run: 
for (seed in sample.int(1e8, 100)) {
  cat("seed =", seed, "\n")
  meditate::PlotMandala(seed = seed)
  ans <- if (interactive()) readline("continue? [Y/n]: ") else "n"
  if (tolower(substr(ans, 1, 1)) == "n") break
}

svglite::svglite("mandala.svg", width = 7, height = 7, bg = "transparent")
meditate::PlotMandala(seed = 8471)
grDevices::dev.off()

grDevices::pdf("mandala.pdf")
meditate::PlotMandala(seed = 8471)
grDevices::dev.off()

## End(Not run)

meditate documentation built on March 26, 2020, 9:37 p.m.