zoom | R Documentation |
Selects a region of a fractal image and zooms into it.
zoom(
col = c(heat.colors(49), "black"),
fun = "mandelbrot",
mu,
nx = 600,
ny = 600,
iter = NULL,
plot = TRUE,
invisible = TRUE
)
col |
the color palette to plot the set |
fun |
which fractal function to plot, currently only the Mandelbrot |
mu |
parameter from the Julia set (not used) |
nx |
number of subdivisions in the x-axis (for plotting) |
ny |
number of subdivisions in the y-axis (for plotting) |
iter |
number of iterations to calculate the set |
plot |
whether to plot the zoomed-in area |
invisible |
whether to return a matrix with the calculated iterations |
Currently the function only zooms into the Mandelbrot set. The set should
be plotted with the image
function. Then, a call to zoom
uses
locator
to read the coordinates of two points on the image, selected
by the user using the mouse.
It is recommended that you increase the number of iterations as you zoom into the boundary areas of the set.
## Not run:
z <- mandelbrot()
# The set is black
cols <- c(hcl.colors(n=100, pal="Lisbon"), "black")
image(z, col=cols, las=1)
points(c(-.375,.125), c(.5, 1), pch=19, col="orange")
# Run the zoom command below, then use your mouse to click on
# the two orange dots on the image
zoom(col=cols, iter=100)
# now try to zoom in deeply by clicking on two arbitrary points
# around a region of interest
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.