Skip to contents

Package

ggsketch ggsketch-package
ggsketch: Grammar-Native Hand-Drawn Geoms for 'ggplot2'

Lines & points

Sketchy paths, connected lines, and roughened-marker scatter points.

GeomSketchLine geom_sketch_line()
Sketchy line geom
GeomSketchPath geom_sketch_path()
Sketchy path geom
GeomSketchPoint geom_sketch_point()
Sketchy point geom
geom_sketch_jitter()
Sketchy jittered points
geom_sketch_count()
Sketchy count geom
geom_sketch_function()
Sketchy function curve
GeomSketchRug geom_sketch_rug()
Sketchy marginal rug

Bars, tiles & rectangles

The signature filled look — roughened outlines with hachure-style fills.

Comparisons & change

Paired and ranked values — gaps, before/after, rate of change, and rank over time.

Distributions

geom_sketch_histogram() geom_sketch_freqpoly()
Sketchy histogram and frequency polygon
geom_sketch_density()
Sketchy density geom
StatSketchDensityRidges GeomSketchRidgeline geom_sketch_ridgeline()
Sketchy ridgeline (joyplot)
GeomSketchDotplot geom_sketch_dotplot()
Sketchy dot plot
geom_sketch_ecdf()
Sketchy empirical cumulative distribution
GeomSketchViolin geom_sketch_violin()
Sketchy violin plot
GeomSketchBoxplot geom_sketch_boxplot()
Sketchy boxplot
StatSketchBeeswarm geom_sketch_beeswarm()
Sketchy beeswarm chart
geom_sketch_bin2d() geom_sketch_bin_2d()
Sketchy 2-D bin heatmap
GeomSketchHex geom_sketch_hex()
Sketchy hexagonal heatmap

Contours & 2-D density

Engraving & tonal shading

Continuous tone built from hatch-line density (etching / banknote style), computed from geometry rather than tiled from a motif.

GeomSketchEngrave GeomSketchShade geom_sketch_engrave() geom_sketch_shade()
Sketchy engraving: tonal shading by hatch-line density
scale_tone_continuous() scale_engrave()
Continuous scale for the engraving tone aesthetic

Models & quantiles

geom_sketch_quantile()
Sketchy quantile regression lines
geom_sketch_qq() geom_sketch_qq_line()
Sketchy quantile-quantile plot

Areas, ribbons & curves

Intervals & uncertainty

Reference lines

Circular & composed

Pie, donut & rose charts

Hand-drawn radial part-to-whole charts that stay round on any panel shape, including the Nightingale coxcomb rose.

GeomSketchPie geom_sketch_pie() geom_sketch_donut()
Sketchy pie and donut charts
geom_sketch_rose()
Sketchy coxcomb / Nightingale rose chart

Part-to-whole

Square, nested and radial part-to-whole charts.

StatSketchWaffle geom_sketch_waffle()
Sketchy waffle chart
StatSketchTreemap GeomSketchTreemap geom_sketch_treemap()
Sketchy treemap
geom_sketch_sunburst()
Sketchy sunburst (hierarchy) chart

Calendar & time

Hand-drawn heatmaps over the calendar and whiteboard project plans.

StatSketchCalendar geom_sketch_calendar()
Sketchy calendar heatmap
GeomSketchGantt geom_sketch_gantt()
Sketchy Gantt / timeline chart

Trees & clustering

Hierarchical-clustering trees with roughened elbow connectors.

geom_sketch_dendrogram()
Sketchy dendrogram (hierarchical-clustering tree)

Networks

Hand-drawn graphs - roughened nodes and edges, placed by a pure-R force-directed layout (no graph dependency required).

GeomSketchEdge geom_sketch_edge() GeomSketchNode geom_sketch_node()
Sketchy network edges and nodes
sketch_graph()
Build node and edge data for a sketch network
force_layout()
Force-directed graph layout (Fruchterman-Reingold)

Maps

Hand-drawn simple-features (sf) maps - roughened polygon, line and point geometry in one call (plots in planar coordinates).

GeomSketchSfPolygon geom_sketch_sf()
Sketchy simple-features (sf) maps

Radar

Spider / radar charts - one roughened polygon per series over a web.

StatSketchRadar GeomSketchRadar geom_sketch_radar()
Sketchy radar (spider) chart

Chord & arc diagrams

Relational diagrams - nodes on a circular rim with ribbons through the centre, or nodes on a line joined by semicircular arcs.

geom_sketch_chord()
Sketchy chord diagram
geom_sketch_arc_diagram()
Sketchy arc diagram

Alluvial & Sankey

Categorical axes joined by frequency-weighted flows.

geom_sketch_alluvial()
Sketchy alluvial / Sankey diagram

Parallel coordinates

Numeric axes crossed by one roughened polyline per observation.

geom_sketch_parallel()
Sketchy parallel-coordinates plot

Mosaic & Marimekko

Area-proportional tiles - two categoricals as a mosaic, or variable-width stacked bars as a Marimekko.

geom_sketch_mosaic()
Sketchy mosaic plot
geom_sketch_marimekko()
Sketchy Marimekko (variable-width stacked bar) chart

Motion

Animate a sketch plot - re-seed its wobble each frame for the hand-drawn “boiling line” effect, or progressively reveal it with a draw-on wipe. boil_gganimate() adds the boil on top of a gganimate data transition.

animate_sketch()
Animate a sketch plot by "boiling" its lines
boil_gganimate()
Boil a gganimate animation (sketch wobble + data transitions)

Text, annotations, theme & fonts

Handwriting text, the content-aware arrow / callout / hull-mark toolkit, one-off annotations, theming, and font helpers.

geom_sketch_text() geom_sketch_label()
Sketchy text and labels
GeomSketchTextRepel GeomSketchLabelRepel geom_sketch_text_repel() geom_sketch_label_repel()
Sketchy repelled text and labels
annotate_sketch()
Sketchy annotations
GeomSketchBracket geom_sketch_bracket()
Sketchy significance / comparison brackets
GeomSketchArrow geom_sketch_arrow()
Sketchy content-aware arrows
annotate_sketch_arrow()
Add a one-off sketchy arrow annotation
GeomSketchCallout geom_sketch_callout()
Sketchy callouts (boxed labels with a leader arrow)
annotate_sketch_callout()
Add a one-off sketchy callout annotation
annotate_sketch_highlight() annotate_sketch_underline()
Highlighter swipes and hand-drawn underlines
GeomSketchMarkHull geom_sketch_mark_hull()
Sketchy hull marks around point groups
GeomSketchMarkCircle GeomSketchMarkEllipse GeomSketchMarkRect geom_sketch_mark_circle() geom_sketch_mark_ellipse() geom_sketch_mark_rect()
Sketchy bounding marks around point groups
theme_sketch()
A hand-drawn theme for ggplot2
ggsketch_check_fonts()
Check for optional handwriting fonts
register_sketch_font()
Register a handwriting font for reproducible sketch text
ggsketch_save()
Save a sketch plot with a font-aware device

Drawing media

The medium system — how a stroke is laid down (pen, ink, fountain pen, ballpoint, brush, pencil, charcoal, pastel, marker, crayon, spray) — and its mappable scale.

sketch_media()
The available drawing media
scale_medium_discrete()
Discrete scale for the drawing medium aesthetic

Paper & ground

Drawing surfaces for theme_sketch(paper = ) — ruled, gridded, aged, blueprint, chalkboard and kraft grounds rendered as vector textures.

sketch_papers()
The available paper grounds
paper_grain()
Wash-feathering grain factor for a paper ground
element_sketch_paper()
Paper-ground theme element

Style presets

One-call looks — paper, palette and default ink bundled per style (notebook, chalkboard, blueprint, field notes, graphite).

sketch_style()
Apply a complete hand-drawn style in one call
sketch_styles()
The available style presets

Sketch frame & colour scales

Hand-drawn theme elements (gridlines, panel border, axis ticks) and a matching paper-and-ink colour palette.

element_sketch_line() element_sketch_rect()
Hand-drawn theme elements
coord_sketch()
A hand-drawn coordinate system
coord_sketch_polar()
A hand-drawn polar coordinate system
scale_colour_sketch() scale_color_sketch() scale_fill_sketch() scale_colour_sketch_c() scale_color_sketch_c() scale_fill_sketch_c()
Sketch colour and fill scales
scale_roughness_continuous() scale_roughness()
Continuous scale for the sketch roughness aesthetic
scale_pressure_continuous() scale_pressure()
Continuous scale for the sketch pressure aesthetic
sketch_palette()
The ggsketch qualitative colour palette

Legend keys

The sketchy draw_key functions wired into every geom.

Building blocks (grid grobs — Layer 2)

Lower-level grobs that re-roughen in device space inside makeContent().

sketch_path_grob()
Create a sketchy path grob
sketch_stroke_grob()
Create a variable-width sketch stroke grob
sketch_spray_grob()
Create an airbrush / spray stroke grob
sketch_polygon_grob()
Create a sketchy polygon grob with optional hachure fill
sketch_ellipse_grob()
Create a sketchy ellipse / circle grob
sketch_wedge_grob()
Create a sketchy pie/donut-wedge grob
sketch_arrow_grob()
Create a sketchy arrow grob
sketch_callout_grob()
Create a sketchy callout grob (boxed label + leader arrow)
sketch_repel_grob()
Create a sketchy repelled-label grob
sketch_band_grob()
Create a sketchy filled-band grob (hole-aware region)
sketch_engrave_grob()
Create a sketchy engraving grob (tonal cross-hatch by line density)
sketch_dotplot_grob()
Create a sketchy dot-plot grob (stacked circular dots)

Core geometry (Layer 1 — pure, no grid/ggplot2)

The number-to-number routines that produce the hand-drawn coordinates.

roughen_polyline()
Roughen a polyline (multiple connected segments)
rough_ellipse()
Roughen an ellipse into one or more sketch stroke paths
rough_arc()
Roughen an elliptical arc into one or more sketch stroke paths
rough_bezier()
Roughen a cubic Bezier curve
hachure_fill()
Fill a polygon with hachure lines using the AET scan-line algorithm
hachure_fill_multi()
Fill a multi-ring region with hachure lines (hole-aware)
sketch_fill()
Dispatch fill-style to the appropriate Layer-1 fill function
sketch_fill_multi()
Dispatch fill-style for a multi-ring (hole-aware) region
engrave_fill()
Fill a region with tonal engraving (line density follows a tone field)
engrave_ladder()
Build a tonal hatch ladder for engraving fills
curve_fill()
Flatten a closed Bezier boundary to a polygon, then fill
stroke_profile()
Width-profile presets for stroke_ribbon()
stroke_ribbon()
Build a variable-width stroke as a closed polygon ribbon
sketch_arrowheads()
The available arrowhead styles
arrowhead()
Build the ideal paths for one arrowhead
leader_path()
Route a leader line from a box edge to a target
repel_layout()
Repel overlapping label boxes away from each other and their anchors
spray_scatter()
Scatter a cloud of dots along a path (airbrush / spray)
watercolor_wash()
Build a watercolour wash for a polygon region
watercolor_wash_multi()
Build a hole-aware watercolour wash for a multi-ring region
wash_bleed()
Pigment bleed between two overlapping wash regions
treemap_layout()
Squarified treemap layout
paper_spec()
Palette + layout spec for a paper ground
paper_primitives()
Build the vector primitives for a paper ground