This function draws the Mandelbrot set and other related fractal sets on the canvas.
canvas_mandelbrot(
colors,
iterations = 100,
zoom = 1,
set = c("mandelbrot", "multibrot", "julia", "ship"),
left = -2.16,
right = 1.16,
bottom = -1.66,
top = 1.66,
resolution = 500
)
a string or character vector specifying the color(s) used for the artwork.
a positive integer specifying the number of iterations of the algorithm.
a positive value specifying the amount of zoom to apply.
a character indicating which fractal set to draw. Possible options are mandelbrot
for the Mandelbrot set, multibrot
for variations of the Mandelbrot set (aka the Multibrot sets), julia
for the Julia set and ship
for the Burning ship set.
a value specifying the minimum location on the x-axis.
a value specifying the maximum location on the x-axis.
a value specifying the minimum location on the y-axis.
a value specifying the maximum location on the y-axis.
resolution of the artwork in pixels per row/column. Increasing the resolution increases the quality of the artwork but also increases the computation time exponentially.
A ggplot
object containing the artwork.
colorPalette
# \donttest{
canvas_mandelbrot(colors = colorPalette("tuscany1"), set = "mandelbrot")
canvas_mandelbrot(colors = colorPalette("flag"), set = "julia", zoom = 2)
# }