contour_plot | R Documentation |
Creates a ggplot2-compatible contour plot of a function of two variables.
contour_plot(
...,
npts = 100,
labels = TRUE,
filled = TRUE,
contours_at = NULL,
n_contours = 10,
n_fill = 50,
alpha = 1,
fill_alpha = 0.1,
label_alpha = 1,
label_placement = 0.5,
contour_color = "blue",
label_color = contour_color,
skip = 1,
guide = FALSE,
guide_title = "output",
color_scale = scale_color_viridis_c(),
fill_scale = scale_fill_viridis_d()
)
... |
Canonical first "three" arguments: |
npts |
Integer number of points on each axis at which to evaluate the function |
labels |
Logical flag: label the contours |
filled |
Logical flag: fill between the contours |
contours_at |
Vector of numbers. Contours will be drawn at these levels of the output. |
n_contours |
hint at number of contours to show |
n_fill |
Integer number of points for calculating fill |
alpha |
Transparency of contours in |
fill_alpha |
Transparency of fill |
label_alpha |
Likewise, for contour labels |
label_placement |
A number, between 0 and 1, suggesting where to place the contour labels. Default: 0.5. This can be useful when there are two contour layers in one plaot. |
contour_color |
Set to a string, e.g. |
label_color |
Defaults to |
skip |
Small integer. Skip this many contours between labeled contours |
guide |
Logical flag, whether to show a color guide. |
guide_title |
Character string for title of guide (if any) |
color_scale |
See ggplot2 color scales. |
fill_scale |
See ggplot2 fill scales |
ggplot2 graphics layers
## Not run:
contour_plot(sin(0.2*x*y) ~ x & y, domain(x=-10.3:4.5, y=2:7.5))
contour_plot(x + y ~ x & y)
contour_plot(sin(0.2*x*y)) # but better to use tilde expression
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.