Learn R Programming

ggimage (version 0.3.6)

draw_key: key drawing function

Description

draw_key_image() draws the legend key of image layers (i.e. geom_image()). The type of the key is determined by the global option ggimage.keytype, which supports "point" (the default when the option is unset), "rect", "image" and "blank" (no key, the behaviour of image layers before the key was implemented). An unsupported value falls back to "point" with a warning.

Usage

draw_key_image(data, params, size)

Value

A grid grob

Arguments

data

A single row data frame containing the scaled aesthetics to display in this key

params

A list of additional parameters supplied to the geom.

size

Width and height of key in mm

Details

Image layers have no default colour, so colour can be missing (i.e. NULL) or NA in data, for instance when only alpha is mapped. Such keys fall back to "black", so that alpha stays visible in the legend.