canvas_function {aRtsy}R Documentation

Draw Functions

Description

This function paints functions with random parameters on a canvas.

Usage

canvas_function(
  colors,
  background = "#fafafa",
  by = 0.01,
  polar = TRUE,
  formula = NULL
)

Arguments

colors

a string specifying the color used for the artwork.

background

a character specifying the color used for the background.

by

a value specifying the step size between consecutive points.

polar

logical. Whether to draw the function with polar coordinates.

formula

optional, a named list with 'x' and 'y' as structured in the example. If NULL (default), chooses a function with random parameters.

Value

A ggplot object containing the artwork.

Author(s)

Koen Derks, koen-derks@hotmail.com

References

https://github.com/cutterkom/generativeart

See Also

colorPalette

Examples


set.seed(10)

# Simple example
canvas_function(colors = colorPalette("tuscany1"))

# Advanced example
formula <- list(
  x = quote(x_i^2 - sin(y_i^2)),
  y = quote(y_i^3 - cos(x_i^2))
)
canvas_function(colors = "firebrick", formula = formula)



[Package aRtsy version 0.2.4 Index]