Curves show predictions and intervals. Grouped numeric conditions show a
surface, with predictions mapped to fill and, for surface = "3d", height.
Remaining conditions create separate facets. Flat surfaces show estimates;
ci_3d = TRUE adds the returned lower and upper interval surfaces in 3D.
Usage
# S3 method for class 'conditional_values'
draw(
object,
facet_scales = "fixed",
discrete_colour = NULL,
discrete_fill = NULL,
xlab = NULL,
ylab = NULL,
...,
surface = c("raster", "tile", "3d"),
surface_3d = list(),
continuous_fill = NULL,
contour = TRUE,
n_contour = NULL,
ci_3d = FALSE,
zlab = NULL
)Arguments
- object
an object of class
"conditional_values", the result of a call toconditional_values().- facet_scales
character; should facets have the same axis scales across facets? See
ggplot2::facet_wrap()for details. Options are:"fixed"(default),"free_x","free_y", and"free".- discrete_colour
a suitable colour scale to be used when plotting discrete variables.
- discrete_fill
a suitable fill scale to be used when plotting discrete variables.
- xlab
character; label for the x axis of the plot.
- ylab
character; label for the prediction axis of a curve, or the second covariate axis of a surface.
- ...
additional arguments; currently unused.
- surface
character;
"raster"(default),"tile", or"3d". Applies to grouped numeric conditions. Three-dimensional surfaces require the optional ggcube package. Irregular flat grids use rectangles bounded by adjacent coordinate midpoints.- surface_3d
named list of view options passed to
ggcube::coord_3d(), for examplelist(yaw = 45, persp = FALSE). The default view usesggcube::light(backface_scale = 1). A suppliedlightreplaces that lighting specification. The same view applies to all panels; gratia retains its plot theme.- continuous_fill
a suitable fill scale to be used when plotting continuous variables.
- contour
logical; draw contour lines on surfaces? Defaults to
TRUE.- n_contour
numeric; the number of contour bins. Will result in
n_contour - 1contour lines being drawn. Seeggplot2::geom_contour().- ci_3d
logical; add the returned lower and upper interval surfaces when
surface = "3d"? Defaults toFALSE.- zlab
character; label for the surface fill legend and 3D height axis. Defaults to the prediction label, or the difference and its scale for conditional differences.
Label layout
Pass label_control = draw_label_control(...) to draw() to wrap discrete
axis labels and legend text, stagger discrete tick labels, or adjust legend
and colour-bar layout. Settings apply to each panel, including unwrapped
plot lists. See draw_label_control() for the available settings.
