Description Usage Arguments Value Examples
Render 3d observations as contours.
1 | render_contour(data, x, y, z, nbreaks = 10, breaks = NULL)
|
data |
A data frame. |
x,y,z |
3d location of each point |
nbreaks,breaks |
Either the number of breaks between the smallest and largest z values, or the positions of the breaks. |
A path geometry.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | n <- 50
waves <- expand.grid(
x = seq(-pi, pi, length = n),
y = seq(-pi, pi, length = n)
)
r <- sqrt(waves$x ^ 2 + waves$y ^ 2)
waves$ripple <- cos(r ^ 2) * exp(-r / 6)
waves$hill <- exp(1 - r)
waves %>% render_contour(~x, ~y, ~hill) %>% plot()
waves %>% render_contour(~x, ~y, ~ripple) %>% plot()
# Show only where function crosses 0
waves %>% render_contour(~x, ~y, ~ripple, breaks = 0) %>% plot()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.