geom_subplot2d(mapping, bins = 10, binwidth = NULL, breaks = NULL, data = waiver(), x_scale = identity, y_scale = identity, width.adjust = 0.95, height.adjust = 0.95, position = "identity", reference = ref_box(), ply.aes = TRUE, .ref = FALSE)
aes
. This mapping should contain x, y, and subplot
aesthetics. All other aesthetics will be ignored - consider placing them in
the subplot aesthetics's mapping instead. The subplot aesthetic should be a
layer or plot specification. For example, the subplot aesthetic could be the
output of qplot
or geom_point
.
Any data argument in the subplot aesthetic will be ignored, the subplot
mapping will be applied to the data inherited by the geom_subplot2d layer.ggplot
.identity
(default), the x limits within each
glyph will correspond to the range of x across all glyphs. This aids
comparison because each glyph will use the same scale. If x_scale equals
free
, each glyph will use its own x scale. The limits of this
scale will be set to the range of x values in that glyph.ref_box
, ref_hline
,
and ref_vline
. By default, reference
is set to ref_box, which creates the familiar mesh pattern associated with
grids.ply_aes
. If FALSE
aesthetics are calculated based on entire data set for the layer.## Not run:
# ggplot(casualties) +
# map_afghanistan +
# geom_subplot2d(aes(lon, lat,
# subplot = geom_bar(aes(victim, ..count.., fill = victim))),
# bins = c(15,12), ref = NULL, width = rel(0.8)) +
# coord_map()
# ## End(Not run)
Run the code above in your browser using DataLab