geom_braid_contour | R Documentation |
Generate contours of a smoothed two-dimensional response surface
geom_braid_contour(
mapping = NULL,
data = NULL,
stat = "braid_contour",
position = "identity",
...,
bins = NULL,
binwidth = NULL,
breaks = NULL,
npoints = 50,
tight = FALSE,
trim = TRUE,
shared = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
stat_braid_contour(
mapping = NULL,
data = NULL,
geom = "contour",
position = "identity",
...,
bins = NULL,
binwidth = NULL,
breaks = NULL,
npoints = 50,
tight = FALSE,
trim = TRUE,
shared = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
... |
Other arguments passed on to
|
bins |
Number of contour bins. Overridden by |
binwidth |
The width of the contour bins. Overridden by |
breaks |
One of:
Overrides |
npoints |
The number of interpolated values in the x- and y- directions that are used to generate the smoothed raster function |
tight |
If true, the generated raster will span the precise range of
transformed and plotted data; this will produce a range of tiles that are
strictly smaller than those produced by geom_braid (as those tiles extend
above and below the plotted tile centers). If |
trim |
Should values that are finite in one dimension be dropped if their finite coordinates lie outside the bounds of the main grid? |
shared |
Should marginal offsets and trimming be calculated separately
for each facet if plots are faceted. If |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
geom |
The geometric object to use to display the data for this layer.
When using a
|
When evaluating a plotted response surface it is often more effective to plot the precise contours at which a set of levels is reached by the combination. Because ggplot2::stat_contour requires that data lie in an evenly space raster grid (and does not support duplicated values), it is difficult to apply to more discrete or irregularly sampled data. This function uses the same smoothing and interpolation utilities as geom_braid_smooth to preprocess and smooth data, which is then passed to the contour estimation code of ggplot2::stat_contour, producing contours which are smoothed and sufficiently regularly spaced.
surface <- antagonisticExample
ggplot(surface,aes(x=concA,y=concB))+
geom_braid_smooth(aes(fill=measure))+
geom_braid_contour(aes(z=measure),colour="black",breaks=((1:9)/10))+
scale_x_log10("Drug A")+
scale_y_log10("Drug B")+
scale_fill_distiller("Effect",palette="RdYlBu")+
coord_equal()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.