HMPlot

charts

Chart patterns composed from core marks and transforms; hm.charts in Python.

Usage

Chart patterns live in hmplot/charts in Svelte and hm.charts in Python. They compose the core marks and transforms; use their reference pages to choose a pattern and its options.

<script>
  import { Plot } from "hmplot";
  import { Bar } from "hmplot/charts";
</script>
<Plot data={{ category: ["A", "B"], value: [2, 3] }}>
  <Bar x="category" y="value" />
</Plot>
import hmplot as hm
with hm.Plot(data={"category": ["A", "B"], "value": [2, 3]}) as plot:
    hm.charts.Bar(x="category", y="value")

The catalog includes Bar, Histogram, BoxPlot, Violin, Swarm, Pie, Lollipop, Smooth, Ecdf, DensityContour, DensityBands, RuleX, RuleY, Callout, Crosshair, ErrorBars and Arrows. Python’s old root names raise an error naming the replacement; Svelte imports must use the charts module. Core marks such as Points, Line, Rect, Text and Segments stay in hmplot.

Building blocks

PatternComposition
BarBarGeometry transform and Prism
HistogramBin transform and Rect; a hidden Points part supplies brushing
BoxPlotBoxStats and BoxOutliers transforms, Rect, Segments and Points
ViolinDensity, Area and Anchor
SwarmDodge and Points
PiePieGeometry, Rect and a polar Frame
LollipopBarGeometry, Segments and Points
SmoothRegression, Area and Line
EcdfEmpirical-distribution transform and a step Line
DensityContourDensity, Contour and Segments
DensityBandsDensity, Contour, Filter and Polygon
RuleX, RuleYSegments placed at the frame edges
CalloutText with a box and leader
CrosshairSegments and Text, driven by the pointer
ErrorBarsSegments with bar caps
ArrowsDirected segments with arrowheads

Related examples

Bar chart

Histogram bins