Draws a hand-drawn coxcomb (polar area) chart: each category of x occupies
an equal angular wedge and its value sets the radius, so the wedges fan out
like a rose. With area_true = TRUE the sector area (not radius) encodes
value, as in Florence Nightingale's original mortality roses. An optional
fill category stacks radially within each wedge. Like geom_sketch_chord()
it is a constructor returning a list of ordinary sketch layers (roughened
annular sectors + labels), so it composes with +; pair it with
coord_equal() and theme_void(), and add scale_fill_sketch().
geom_sketch_rose(
data,
x,
value,
fill = NULL,
...,
area_true = FALSE,
fill_style = "solid",
alpha = 0.9,
colour = "grey30",
label = TRUE,
label_size = 3.2,
label_colour = "grey20",
roughness = 1,
bowing = 1,
n_passes = 2L,
seed = NULL
)A list of ggplot2 layers.
A data frame.
Unquoted column name of the category that sets the angular wedges.
Unquoted column name giving the magnitude (radius / area).
Optional unquoted column name of a second category to stack
radially within each wedge (NULL = one segment per wedge, coloured by x).
Other arguments passed on to the sector layer.
If TRUE, sector area is proportional to value (radius is the
square root) - Nightingale's convention. Default FALSE (radius is
proportional to value).
Sector fill style; see geom_sketch_polygon(). Default
"solid".
Sector opacity. Default 0.9.
Sector outline colour. Default "grey30".
Draw category labels around the rim? Default TRUE.
Label text controls.
Sketch parameters.
Other sketch-geoms:
GeomSketchAbline,
GeomSketchArrow,
GeomSketchBoxplot,
GeomSketchBracket,
GeomSketchCallout,
GeomSketchChicklet,
GeomSketchCol,
GeomSketchContourFilled,
GeomSketchCurve,
GeomSketchDotplot,
GeomSketchDumbbell,
GeomSketchEdge,
GeomSketchEllipse,
GeomSketchEngrave,
GeomSketchGantt,
GeomSketchHex,
GeomSketchLine,
GeomSketchLinerange,
GeomSketchLollipop,
GeomSketchMarkCircle,
GeomSketchMarkHull,
GeomSketchPath,
GeomSketchPoint,
GeomSketchPolygon,
GeomSketchRect,
GeomSketchRibbon,
GeomSketchRug,
GeomSketchSegment,
GeomSketchSfPolygon,
GeomSketchSlope,
GeomSketchSmooth,
GeomSketchSpoke,
GeomSketchTextRepel,
GeomSketchViolin,
StatSketchBeeswarm,
StatSketchCalendar,
StatSketchDensityRidges,
StatSketchFunnel,
StatSketchPie,
StatSketchPyramid,
StatSketchRadar,
StatSketchStream,
StatSketchTreemap,
StatSketchWaffle,
StatSketchWaterfall,
annotate_sketch(),
annotate_sketch_arrow(),
annotate_sketch_callout(),
annotate_sketch_highlight(),
geom_sketch_alluvial(),
geom_sketch_arc_diagram(),
geom_sketch_bin2d(),
geom_sketch_bump(),
geom_sketch_chord(),
geom_sketch_contour(),
geom_sketch_count(),
geom_sketch_dendrogram(),
geom_sketch_density(),
geom_sketch_density2d(),
geom_sketch_ecdf(),
geom_sketch_function(),
geom_sketch_histogram(),
geom_sketch_jitter(),
geom_sketch_marimekko(),
geom_sketch_mosaic(),
geom_sketch_parallel(),
geom_sketch_qq(),
geom_sketch_quantile(),
geom_sketch_sunburst(),
geom_sketch_text(),
sketch_graph()
library(ggplot2)
deaths <- data.frame(
month = month.abb,
n = c(12, 18, 25, 30, 22, 15, 10, 14, 20, 28, 24, 16)
)
ggplot() +
geom_sketch_rose(deaths, month, n, area_true = TRUE, seed = 1L) +
scale_fill_sketch() +
coord_equal() +
theme_void()
Run the code above in your browser using DataLab