Skip to main content

Module geom

Module geom 

Source

Modules§

arcdiagram
Arc diagram: geom_arcdiagram. Nodes sit on a line, links are arcs between them whose thickness is the link weight; node size is the total flow. Layout by StatArcdiagram.
area
arrow
Arrowheads for segment/curve/path/line, modelled on R grid’s arrow().
bar
bin2d
blank
boxplot
bracket
bullet
Bullet chart (Stephen Few): geom_bullet. Per category, qualitative range bands (dark = poor → light = good), a narrow bar for the actual value and a perpendicular tick for the target. Horizontal by default.
candlestick
Financial OHLC charts: geom_candlestick (body + wick; filled or hollow), geom_ohlc (bar with open/close ticks), geom_hlc (bar with a close tick only) and geom_heikin_ashi (candles over Heikin-Ashi values). Map x plus the open/high/low/close aesthetics; the y scale trains on the high–low range.
censor
Censor marks for survival curves: + glyphs at the (time, survival) points where observations were censored (ggsurvfit’s add_censor_mark).
chord
Chord diagram / dependency wheel: geom_chord. Nodes are arcs around a circle; each link is a ribbon from its source’s band to its target’s band through the centre. Layout by StatChord.
col
contour
cooks
Cook’s-distance contours for a residuals-vs-leverage plot (R’s plot.lm(which = 5)): with x = leverage h and y = standardized residual r, Cook’s distance is D = r² h / (p (1 − h)), so the points with D = level lie on r = ±√(level · p · (1 − h) / h).
count
crossbar
curve
density
density2d
dotplot
errorbar
errorbarh
Horizontal error bars (geom_errorbarh): a line from (xmin, y) to (xmax, y) with vertical end caps — horizontal confidence intervals in a coefficient forest or a time-to-event plot.
flags
Event flags on time series: geom_flags. Each row (x, label) is a small flag on a stem, pinned either to the x axis or — with GeomFlags::on_series — to a series’ value at that x (linearly interpolated). Flags at the same x stack upward instead of overlapping.
freqpoly
funnel
Funnel and pyramid charts: geom_funnel / geom_pyramid. Stages are stacked top to bottom as centred polygons; labels show each stage’s name, value and share. Layout by StatFunnel.
hex
histogram
jitter
line
linerange
lollipop
Lollipop and dumbbell charts: geom_lollipop (a stem from the baseline to the value, capped with a dot) and geom_dumbbell (a segment between two values per category, with a dot at each end). One layer each; both turn horizontal under coord_flip.
marimekko
Variable-width column charts: geom_variwide (bar width ∝ weight, height = y) and geom_marimekko (columns ∝ their total, split into 100 % stacked segments by fill). Layout by StatMarimekko; the builders put the category names under the column centres.
network
Network graph: geom_network. Nodes from an edge list laid out by StatNetwork (force-directed by default); edges as lines whose width follows the weight (with arrowheads when directed), nodes sized by degree, optional labels.
pack
Packed bubble chart: geom_packed_bubble. Circles with area ∝ weight packed without overlap, optionally clustered by subgroup (each cluster outlined). Layout by StatPack.
pareto
Pareto chart: geom_pareto. Categories as bars sorted by value, plus the cumulative total as a line with points, read against a 0–100 % secondary axis (SecAxis::percent_of_max).
partition
Hierarchical partition charts: geom_sunburst (under coord_polar) and geom_icicle (Cartesian). One band per hierarchy level; each node’s span is proportional to its value and nested inside its parent’s. Layout by StatPartition.
path
point
pointrange
polygon
qq
raster
rect
refline
Reference lines: geom_hline, geom_vline, geom_abline.
renko
Renko and point-and-figure charts: geom_renko (bricks) and geom_point_figure (columns of X and O). Map y to the price in time order; the stats (StatRenko, StatPointFigure) replace time with brick / column numbers.
repel
Repelling text labels — geom_text_repel / geom_label_repel (R’s ggrepel).
ribbon
rug
sankey
Sankey diagram: geom_sankey. Nodes are bars stacked in columns; links are ribbons whose width is the flow, drawn as smooth S-curves between the source’s and target’s bands. Layout by StatSankey.
segment
smooth
spoke
step
text
tile
tilemap
Tile-grid cartograms: geom_tilemap. Each row is one equal-size tile (square, hexagon, circle or diamond) at grid position x (column) / y (row, 0 = top), filled by fill and labelled by label — e.g. US states or EU countries as a hex map. The grid is fitted into the panel with one uniform scale, so tiles stay regular at any aspect ratio.
timeline
Timeline: geom_timeline. Events along an x (usually date) axis on a central baseline; each is a dot with a stem to a boxed label. Labels are stacked on alternating levels above and below the line so they never overlap (greedy, at draw time in pixels); a span-end column turns an event into a span drawn as a band on the baseline.
tree
Tree diagrams: geom_tree (tidy tree), org charts (boxed nodes) and geom_dendrogram. Layout by StatTree; links drawn as elbows, steps, diagonals or straight lines.
treemap
Treemap: geom_treemap. Rectangles tile the panel with area ∝ weight; with a subgroup mapping, tiles nest inside group rectangles drawn with a heavier border and a group label. Layout by StatTreemap.
variablepie
Variable-radius pie: geom_variable_pie. Each wedge’s angle encodes y (its share of the total) and its outer radius encodes radius (linearly between min_radius and the full radius — Highcharts’ variablepie). Wedges run clockwise from 12 o’clock in data order; drawn directly in the panel, so the pie stays round.
venn
Venn / Euler diagrams: geom_venn. Translucent circles with area ∝ set size, overlapping by the pairwise intersections; set names and intersection sizes labelled inside their regions. Layout by StatVenn.
violin
waffle
Unit charts: geom_waffle (a square grid of units) and geom_parliament (seats on concentric half-circle arcs). Each unit is one item of its fill category. Layout by StatWaffle.
waterfall
Waterfall (bridge) chart: geom_waterfall. Each step is a bar floating from the previous running total; total bars rise from 0. Bars are coloured through the fill scale on the stat’s direction column (Increase / Decrease / Total), and thin connectors join each bar’s end to the next bar.
windbarb
Wind barbs: geom_windbarb. The standard meteorological glyph — a shaft pointing to where the wind blows from, with half barbs (5 kt), full barbs (10 kt) and pennants (50 kt) at its outer end; calm (< 2.5 kt) is a circle. Speeds are rounded to the nearest 5 kt.
wordcloud
Word cloud: geom_wordcloud. Words sized by weight are placed — the largest first — along an Archimedean spiral from the panel centre at the first spot where their bounding box overlaps no placed word (ggwordcloud / wordcloud2). Layout happens at draw time in pixels, since collisions depend on the rendered text size; it is deterministic (no randomness: rotations come from a hash of the word and seed). Words that don’t fit are left out.
xrange
X-range / Gantt chart: geom_xrange. One horizontal bar per row from xmin to xmax on a discrete y (task) axis, with an optional progress fill, milestones (zero-length tasks as diamonds) and dependency arrows from a predecessor’s end to a task’s start.

Structs§

GeomParams
Fixed (non-mapped) visual parameters for a geom.

Traits§

Geom
Trait for geometric objects that draw data on the plot.