Cookbook
Cookbook
Task-focused techniques for customizing, composing, and exporting charts. See Examples to choose a chart type first, or Guides for concepts that span several APIs.
Annotations and labels
Call out values, ranges, trends, and individual observations.
- Reference Line
- Vertical Reference Line
- Reference Band
- Confidence Band
- Point Marker
- Arrow Annotation
- Annotation Colors
- Data Labels
- Point Labels
- Mathematical Labels
Axes, scales, and orientation
Control domains, axis furniture, ordering, and chart direction.
- Log Scale (X-Axis)
- Log Scale (Y-Axis)
- Indexed-to-100 Comparison
- Percent Stacked Bar
- Step Interpolation
- Sorted Bars
- Horizontal Bar
- Horizontal Grouped Bar
- Horizontal Stacked Bar
- Horizontal Lollipop
- Horizontal Box
- Horizontal Violin
- Horizontal Beeswarm
- Despine
- Full Axis Box
- Axes Through Zero
- Bar Zero Baseline
- Compact Axis Chrome
- Custom Margins
- Margin Buffer
- Data Label Margin
Color and accessibility
Encode values with color and keep charts legible across contexts.
- Color by Category
- Color by Continuous Variable
- Color Map
- Diverging Color Scale
- Diverging Bar (Positive/Negative Color)
- Custom Diverging Colors
- Center a Diverging Scale on Zero
- One Color Scale Across Two Charts
- One Color Per Category Across Two Charts
- Black-and-White Multi-Series
- High-Contrast Theme
- Print-Safe (Grayscale) Theme
- Dark Theme
- Minimal Theme
- SVG Accessibility
Layout, facets, and layers
Combine plots, coordinate scales, and explain layered series.
- Combo Chart (Shared Axis)
- Bar-and-Line Combo
- Dual Y-Axis
- Layer Legend
- Isolines Over a Filled Field
- Facets
- Shared Facet Scale
Statistics and uncertainty
Show estimates, uncertainty, distributions, and dense relationships.
- Best-Fit Trend Line
- Error Bars
- Asymmetric Error Bars
- Error Bars on a Line
- Error Bar Cap Width
- Bubble Size
- Bubble Size Range
- Comparing Distributions (KDE + Rug)
- Narrow Violins
- Violin Bandwidth
- Scale Violin Width by Count
- Ridgeline Overlap
- Dense Corrplot
Export and presentation
Tune chart appearance and produce output for its destination.
- Multi-Format Export
- High-DPI Export
- Custom Typography
- Subtitle & Axis Title Styling
- Bold Points
- Smoothed Line
- Legend Sizing
- Continuous Legend Size
- Bullet Styling
- Half-Circle Gauge
- Effect Scatter Halo
- Radar Fill Alpha
- Radial Bar Styling
- Sankey Node Width
- Waterfall Colors
External and custom data
Use dataframes, numeric types, Python arrays, and custom Mojo containers.
- Plot Named Columns of a DataFrame
- Plot a Long-Form DataFrame
- Facet a DataFrame by a Column
- Grouped DataFrame Facets
- Numeric Types
- NumPy and pandas Data
- Custom Numeric Container
- Custom Categorical Container
End-to-end workflows
Whole analyses, from data to figure, that check what they claim.