View source: R/FlowFieldBackgrounds.R
create | R Documentation |
Creates a plot of a flow field using a color palette
create( xdim = 1920, ydim = 1080, palette = sky, maxLength = 100, iterations = 250, numPoints = 750, curliness = 6.28 )
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 |
A ggplot with the resulting generated image.
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"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.