create: Create

View source: R/FlowFieldBackgrounds.R

createR Documentation

Create

Description

Creates a plot of a flow field using a color palette

Usage

create(
  xdim = 1920,
  ydim = 1080,
  palette = sky,
  maxLength = 100,
  iterations = 250,
  numPoints = 750,
  curliness = 6.28
)

Arguments

xdim

specifies the width of the image

ydim

specifies the height of the image

palette

a list of colors to choose from. built-in palettes include: sky, clouds, ground, neon, retro, glow, seafoam, and pixiedust

maxLength

the maximum possible length of an individual line segment. Shorter values will create shorter lines

iterations

how many times the function will run, increasing the length of each line

numPoints

how many lines will be created by the function. For a densely populated image, use large numbers i.e. > 1000. For a sparsely populated image, use small numbers

curliness

the multiplier for the sin and cos functions in each iteration; determines how wavy the resulting image will be

Value

A ggplot with the resulting generated image.

Examples

create(xdim = 1080, ydim = 1920, palette = ground, maxLength = 20, iterations = 100, numPoints = 1000, curliness = 6.28)
create(palette = neon, maxLength = 1, iterations = 200, numPoints = 500, curliness = 1)

After running this function, if you like what you see, I recommended using the ggsave() function to save the image.
For a non-pixelated image, it is best to take set width = (your xdim multiplied by 10), height = (your ydim multiplied by 10), dpi = 900, and units = "px"


Theo-Jongerius/FlowFieldBackgrounds documentation built on May 21, 2022, 2:29 a.m.