ggplot

package module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 24 Imported by: 0

README

# ggplot

Go Reference Go Report Card CI codecov GitHub release (latest by date)

ggplot

Production-grade Grammar of Graphics for Go.

A pure-Go data visualization library implementing a rigorous, declarative Grammar of Graphics pipeline. Inspired by Hadley Wickham's renowned ggplot2, but architected specifically for Go's type safety and interface-driven engine architecture.

Overview

ggplot provides an expressive, composable API for generating complex data visualizations. It decouples the data manipulation (Apache Arrow, BigQuery, Memory) from the statistical transformations and the final vector rendering, resulting in highly scalable plotting pipelines.

Capability Supported Features
Geometries Point, Line, Path, Step, Bar, Histogram, Area, Density, Rug, HLine, VLine, Text, BoxPlot, Smooth
Statistics Identity, Bin/Count, Density (KDE), Smooth (LOESS + lm), Summary, BoxPlot (Tukey/range whiskers, notch CI)
Scales Linear, Log10, Sqrt, Reverse, Discrete
Color Palettes Viridis, ColorBrewer (sequential, diverging, qualitative), manual, continuous
Faceting Grid (row ~ col), Wrap (NCols/NRows)
Data Backends Native Memory, Apache Arrow IPC/Parquet, BigQuery SQL pushdown
Output PNG, SVG 1.1, PDF 1.4, HiDPI via WithScale()
Theming Default, Classic, Minimal, Dark, BW

Clifford Attractor Butterfly Curve
Clifford attractor ΓÇö 500 k points, alpha blending, continuous color scale Butterfly curve ΓÇö parametric path with color interpolation
Scatter Line Area
Bar Histogram Smooth

Why ggplot?

Data science in Go often suffers from fragmented or overly imperative plotting APIs. ggplot solves this by introducing:

  • Declarative Compositions ΓÇö Build complex charts by layering geometries and statistics instead of drawing pixels.
  • Provider-Agnostic Engines ΓÇö Swap out the underlying dataset execution engine (memory vs arrow) without changing a single line of your plotting code.
  • Publication-Ready Outputs ΓÇö Anti-aliased 2D vector rendering powered by gogpu/gg, saving to PNG, SVG, or PDF at configurable DPI scales.

Quick Start

Installation

go get github.com/TuSKan/ggplot

1. Scatter Plot

package main

import (
	"context"
	"log"

	"github.com/TuSKan/ggplot"
	"github.com/TuSKan/ggplot/aes"
	"github.com/TuSKan/ggplot/dataset"
	"github.com/TuSKan/ggplot/dataset/memory"
	"github.com/TuSKan/ggplot/geom"
)

func main() {
	ctx := context.Background()
	// Initialize a memory engine and construct columns explicitly.
	eng := memory.NewEngine(ctx)
	ds, err := dataset.NewDataset(eng,
		eng.NewFloat64Column("x", []float64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}),
		eng.NewFloat64Column("y", []float64{2, 4, 5, 4, 6, 8, 7, 9, 10, 11}),
	)
	if err != nil {
		log.Fatalln(err)
	}

	// Build the plot using declarative Grammar of Graphics.
	ggplot.New(ds, aes.X("x"), aes.Y("y")).
		Layer(geom.Point(geom.WithSize(5), geom.WithColor("coral"))).
		Layer(geom.Smooth()).
		Labs(ggplot.Title("Quick Start"), ggplot.XLab("X"), ggplot.YLab("Y")).
		Theme("minimal").
		Save(ctx, "scatter.png", 800, 500)
}

2. Faceted Time Series

ggplot.New(ds, aes.X("day"), aes.Y("temp")).
    Layer(geom.Line(geom.WithColor("seagreen"), geom.WithLineWidth(1.5))).
    FacetWrap("season", 2, 0).
    Labs(ggplot.Title("Temperature by Season")).
    Theme("dark").
    Save(ctx, "facets.png", 900, 600)

3. Box Plot with Groups

ggplot.New(ds, aes.X("group"), aes.Y("value")).
    Layer(geom.BoxPlot(geom.WithFill("lightyellow"), geom.WithAlpha(0.8))).
    Labs(ggplot.Title("Distribution by Group")).
    Theme("classic").
    Save(ctx, "boxplot.png", 800, 500)

Architecture & Data Backends

ggplot is built around a rigorous, interface-driven dataset.Table engine. This means you are not limited to []float64 slices. You can back your plots with robust columnar frameworks. See DATASET.md for a deep-dive into the backend engine architecture.

  • Memory Engine (dataset/memory): Lightweight, native Go slices. Best for standard web-server rendering.
  • Arrow Engine (dataset/arrow): Apache Arrow backed IPC streams and Parquet datasets. Provides zero-copy reads from IPC/Parquet files. Best for datasets >1M rows.
  • BigQuery Engine (dataset/bigquery): Lazy SQL pushdown execution. Best for massive data warehouses where filtering and statistics must be executed on the database before streaming the visual aggregate to Go.

Documentation

Document Description
DATASET.md Deep dive into the Engine abstraction, Memory, and Arrow backends
ARCHITECTURE.md Package map, rendering pipeline, design decisions
ROADMAP.md Development plan aligned with the ggplot2 book (3e)
BENCHMARK.md Arrow vs Memory engine performance benchmarks

Project Roadmap

We actively track our development pipeline across multiple capability tiers focusing on Grammar Primitives, Scaling Functions, and Advanced Geometries.

Please see our full Project Roadmap to understand current milestones and architectural expansion goals.

  • ≡ƒö╢ Phases 1ΓÇô4 ΓÇö Core architecture, grammar primitives, data backends, production hardening (in progress)
  • ≡ƒö▓ Phases 5ΓÇô8 ΓÇö Position/colour/other scales, faceting controls
  • ≡ƒö▓ Phases 9ΓÇô12 ΓÇö Annotations, composition (patchwork), maps, networks
  • ≡ƒö▓ Phases 13ΓÇô19 ΓÇö Themes deep-dive, guides, output backends, programming/extensibility

Dependencies

Package Role
gogpu/gg 2D vector rendering with anti-aliased lines, fills, and text
apache/arrow-go Columnar data (zero-copy for IPC/Parquet reads)

Contributing

Contributions are welcome!

License

MIT ΓÇö see LICENSE.

Documentation

Overview

Package ggplot is a production-grade, pure-Go Grammar of Graphics plotting library.

Inspired by R's ggplot2, it provides a declarative, composable API for building statistical visualizations from data, aesthetics, geometries, scales, coordinate systems, facets, and themes.

Quick Start

p := ggplot.New(ds,
    aes.X("x"),
    aes.Y("y"),
    aes.Color("group"),
).
    Layer(geom.Point(geom.WithSize(4), geom.WithAlpha(0.7))).
    Layer(geom.Smooth(geom.WithMethod("lm"))).
    Labs(ggplot.Title("My Plot"), ggplot.XLab("X Axis")).
    Theme("minimal").
    Save("output.png", 1200, 800)

Architecture

The library follows a strict pipeline:

PlotSpec -> Validate -> Stat Transform -> Scale Training -> Layout -> Render

All data flows through the dataset.Dataset abstraction. Multiple engine backends are supported: memory (Go slices), Apache Arrow (columnar arrays), and BigQuery (SQL pushdown). Arrow IPC and Parquet ingest provide zero-copy reads; constructing from Go slices requires one copy.

Index

Constants

View Source
const (
	ColPANEL = "PANEL" // int64 -- facet panel index (0-based)
	ColGroup = "group" // int64 -- group index within a panel (0-based)
)

System column names reserved by the build pipeline. These columns are injected into every layer's dataset during Build.

Variables

View Source
var (
	// ErrUnsupportedFormat is returned for unsupported output formats.
	ErrUnsupportedFormat = errors.New("ggplot: unsupported output format")

	// ErrRenderFailed is returned when rendering fails.
	ErrRenderFailed = errors.New("ggplot: render failed")

	// ErrNoLayers is returned when there are no layers to render.
	ErrNoLayers = errors.New("ggplot: no layers to render")

	// ErrMissingAesthetic is returned when a required aesthetic is missing.
	ErrMissingAesthetic = errors.New("ggplot: missing required aesthetic")

	// ErrInvalidConfig is returned for invalid plot configuration.
	ErrInvalidConfig = errors.New("ggplot: invalid configuration")
)

Sentinel errors for the ggplot package.

Functions

func RegisterDrawer

func RegisterDrawer(t geom.Type, d Drawer)

RegisterDrawer registers a Drawer for a geometry type. Replaces any previously registered drawer for the same type. Third-party geom types should call this at init() time.

Types

type AesMap added in v0.0.4

type AesMap map[string]string

AesMap maps aesthetic channel names to column names.

func ToAesMap added in v0.0.4

func ToAesMap(mappings []aes.Mapping) AesMap

ToAesMap converts a slice of aes.Mapping into an AesMap.

func (AesMap) Merge added in v0.0.4

func (a AesMap) Merge(other AesMap) AesMap

Merge returns a new AesMap with entries from other as base, overridden by entries from the receiver (a takes priority).

type Built added in v0.0.4

type Built struct {
	// contains filtered or unexported fields
}

Built is the result of Plot.Build. It holds fully resolved layer data, trained scales, layout geometry, and theme — everything needed to draw without re-running the grammar pipeline.

This is the Go equivalent of ggplot2's ggplot_build(plot) → built.

func (*Built) Draw added in v0.0.4

func (b *Built) Draw(ctx context.Context, cv canvas.Canvas, width, height int) error

Draw renders the built plot onto the given canvas at the specified dimensions.

This is the Go equivalent of ggplot2's grid.draw(ggplot_gtable(built)).

func (*Built) DrawCanvas added in v0.0.4

func (b *Built) DrawCanvas(ctx context.Context, width, height int) (*canvas.GGCanvas, error)

DrawCanvas creates a new canvas.GGCanvas and draws the built plot onto it.

func (*Built) Labels added in v0.0.4

func (b *Built) Labels() Labels

Labels returns the resolved plot labels.

func (*Built) LayerData added in v0.0.4

func (b *Built) LayerData(panel, layer int) dataset.Dataset

LayerData returns the resolved dataset for the given layer in the given panel. This is the data each geom actually sees after stat/position transforms — the primary introspection API for debugging and platform-independent testing.

func (*Built) NumLayers added in v0.0.4

func (b *Built) NumLayers(panel int) int

NumLayers returns the number of resolved layers in the given panel.

func (*Built) NumPanels added in v0.0.4

func (b *Built) NumPanels() int

NumPanels returns the number of facet panels.

func (*Built) PanelLayout added in v0.0.4

func (b *Built) PanelLayout() Layout

PanelLayout returns the layout geometry.

func (*Built) Save added in v0.0.4

func (b *Built) Save(ctx context.Context, filename string, width, height int, opts ...RenderOpt) error

Save renders the built plot to a file. Format is inferred from extension.

.png — raster PNG (default)
.svg — SVG 1.1 vector
.pdf — PDF 1.4 vector

Options: WithScale for HiDPI output.

func (*Built) Theme added in v0.0.4

func (b *Built) Theme() theme.Theme

Theme returns the resolved theme.

func (*Built) WriteTo added in v0.0.4

func (b *Built) WriteTo(ctx context.Context, w io.Writer, format string, width, height int, opts ...RenderOpt) (int64, error)

WriteTo writes the built plot to w in the given format. Supported formats: "png" (default), "svg", "pdf". Options: WithScale for HiDPI output. Returns the number of bytes written.

type BuiltLayer added in v0.0.4

type BuiltLayer struct {
	Geom         geom.Layer
	Data         dataset.Dataset
	Mapping      AesMap
	ContColorCol string
	ContColScale *colormap.Scale
}

BuiltLayer holds one resolved layer's data after stat transform and grouping. The Data dataset always contains the system column PANEL (int64). When the layer was produced by group splitting, the system column group (int64) is also present.

type BuiltPanel added in v0.0.4

type BuiltPanel struct {
	Label         string
	Layers        []BuiltLayer
	XScale        scale.Scale
	YScale        scale.Scale
	LegendEntries []LegendEntry
	LegendTitle   string
	ColorBarSpec  *ColorBarSpec
	XIsDiscrete   bool
}

BuiltPanel holds one facet panel with its resolved layers and trained scales.

type ColorBarSpec added in v0.0.4

type ColorBarSpec struct {
	Title string
	Cmap  colormap.Cmap
	Norm  colormap.Norm
}

ColorBarSpec describes a continuous color bar legend.

Cmap and Norm replace the previous opaque ColorFunc field: the bar walks Cmap.At directly across the [0,1] range, and Norm provides the data-space labels at the endpoints (and any future intermediate ticks).

type DrawContext

type DrawContext struct {
	Canvas       canvas.Canvas
	Coord        coord.Coord
	Data         dataset.Dataset
	Mapping      AesMap
	Params       geom.Params
	Theme        theme.Theme     // active theme for default styling
	ContColorCol string          // continuous color column (empty if none)
	ContScale    *colormap.Scale // continuous color scale (nil if none)
	W, H         float64         // panel size in pixels
	XMin, XMax   float64         // data domain bounds
	YMin, YMax   float64         // data domain bounds
}

DrawContext holds the rendering parameters passed to a Drawer. It encapsulates the canvas, coordinate system, data, aesthetic mappings, and panel bounds so that Drawer implementations are self-contained.

type Drawer

type Drawer interface {
	Draw(ctx DrawContext)
}

Drawer renders a geometry type onto the canvas. Implementations are registered via RegisterDrawer and looked up by geom.Type during rendering.

func LookupDrawer

func LookupDrawer(t geom.Type) Drawer

LookupDrawer returns the registered Drawer for the given type, or nil.

type DrawerFunc

type DrawerFunc func(DrawContext)

DrawerFunc is an adapter to allow use of ordinary functions as [Drawer]s.

func (DrawerFunc) Draw

func (f DrawerFunc) Draw(ctx DrawContext)

Draw calls f(ctx).

type LabOpt

type LabOpt func(*Labels)

LabOpt is a functional option for configuring plot labels.

func Caption

func Caption(text string) LabOpt

Caption sets the plot caption.

func Subtitle

func Subtitle(text string) LabOpt

Subtitle sets the plot subtitle.

func Title

func Title(text string) LabOpt

Title sets the plot title.

func XLab

func XLab(text string) LabOpt

XLab sets the x-axis label.

func YLab

func YLab(text string) LabOpt

YLab sets the y-axis label.

type Labels added in v0.0.4

type Labels struct {
	Title    string
	Subtitle string
	X        string
	Y        string
	Caption  string
}

Labels holds all text annotations for a plot.

type LayerSpec added in v0.0.4

type LayerSpec struct {
	Geom    geom.Layer
	Mapping AesMap // per-layer aesthetic overrides
}

LayerSpec describes a single visual layer in the plot.

type Layout added in v0.0.4

type Layout struct {
	Rows   int
	Cols   int
	Panels []PanelLayout
}

Layout holds the panel grid dimensions derived from faceting.

type LegendEntry added in v0.0.4

type LegendEntry struct {
	Label string
	Color gg.RGBA
}

LegendEntry describes one item in the legend.

type LegendPos

type LegendPos string

LegendPos controls legend placement.

const (
	LegendRight  LegendPos = "right"
	LegendLeft   LegendPos = "left"
	LegendTop    LegendPos = "top"
	LegendBottom LegendPos = "bottom"
	LegendNone   LegendPos = "none"
)

LegendRight places the legend to the right of the plot.

type PanelLayout added in v0.0.4

type PanelLayout struct {
	Row    int
	Col    int
	XScale scale.Scale
	YScale scale.Scale
}

PanelLayout holds per-panel geometry and trained scale state.

type Plot

type Plot struct {
	// contains filtered or unexported fields
}

Plot is the immutable, declarative plot builder. Every method returns a new Plot with the modification applied, enabling a fluent chaining style.

Plot is safe to share and reuse - modifying a derived plot does not affect the original.

func New

func New(ds dataset.Dataset, globalAes ...aes.Mapping) *Plot

New initializes a plot with a dataset and optional global aesthetic mappings.

func (*Plot) Aes

func (p *Plot) Aes(mappings ...aes.Mapping) *Plot

Aes adds or overrides global aesthetic mappings.

func (*Plot) Build added in v0.0.4

func (p *Plot) Build(ctx context.Context) (*Built, error)

Build resolves the plot specification through the grammar pipeline and returns a *Built containing fully resolved layer data, trained scales, layout geometry, and theme. The result can be inspected via Built.LayerData or rendered via Built.Draw.

This is the Go equivalent of ggplot2's ggplot_build(plot).

func (*Plot) Coord

func (p *Plot) Coord(c coord.Coord) *Plot

Coord sets the coordinate system.

func (*Plot) CoordFlip

func (p *Plot) CoordFlip() *Plot

CoordFlip swaps the x and y axes. This is sugar for setting geom.Horizontal orientation on all layers and swapping the axis labels.

func (*Plot) FacetGrid

func (p *Plot) FacetGrid(rowCol, colCol string) *Plot

FacetGrid applies grid faceting by row and column variables.

func (*Plot) FacetWrap

func (p *Plot) FacetWrap(col string, opts ...facet.WrapOpt) *Plot

FacetWrap applies wrap faceting by a column.

func (*Plot) Labs

func (p *Plot) Labs(opts ...LabOpt) *Plot

Labs configures plot labels (title, subtitle, axis labels, caption).

func (*Plot) Layer

func (p *Plot) Layer(l geom.Layer, localAes ...aes.Mapping) *Plot

Layer adds a geometry layer to the plot with optional per-layer aesthetic overrides.

func (*Plot) LegendPosition

func (p *Plot) LegendPosition(pos LegendPos) *Plot

LegendPosition sets the legend placement.

func (*Plot) Save

func (p *Plot) Save(ctx context.Context, filename string, width, height int, opts ...RenderOpt) error

Save renders the plot to a file at the given dimensions. The output format is inferred from the file extension:

.png — raster PNG (default)
.svg — SVG 1.1 vector
.pdf — PDF 1.4 vector

Options: WithScale for HiDPI output.

func (*Plot) ScaleColor

func (p *Plot) ScaleColor(c colormap.Cmap) *Plot

ScaleColor configures the color aesthetic to use the given colormap. The cmap is composed with a default LinearNorm for continuous data, or used as a Listed palette for discrete data. Pass nil to clear an existing override and fall back to defaults.

func (*Plot) ScaleColorContinuous

func (p *Plot) ScaleColorContinuous(c colormap.Cmap, n colormap.Norm) *Plot

ScaleColorContinuous installs an explicit continuous color scale composed of the given Cmap and Norm. Use this to control LogNorm / TwoSlopeNorm / PowerNorm / data-range limits beyond the simple Plot.ScaleColor form.

func (*Plot) ScaleColorManual

func (p *Plot) ScaleColorManual(m map[string]colormap.Color) *Plot

ScaleColorManual maps category labels to specific colors. Categories not in m fall back to the default Tab10 palette in the order they are encountered during dataset training.

func (*Plot) ScaleFill

func (p *Plot) ScaleFill(c colormap.Cmap) *Plot

ScaleFill is the fill-aesthetic counterpart of Plot.ScaleColor.

func (*Plot) ScaleX

func (p *Plot) ScaleX(scaleType scale.Type, opts ...scale.Opt) *Plot

ScaleX sets the x-axis scale type with optional configuration. Options: scale.WithBreaks, scale.WithLabels, scale.WithFormatter, scale.WithExpand, scale.WithMinorBreaks, scale.WithClipBounds.

func (*Plot) ScaleY

func (p *Plot) ScaleY(scaleType scale.Type, opts ...scale.Opt) *Plot

ScaleY sets the y-axis scale type with optional configuration. Options: scale.WithBreaks, scale.WithLabels, scale.WithFormatter, scale.WithExpand, scale.WithMinorBreaks, scale.WithClipBounds.

func (*Plot) Theme

func (p *Plot) Theme(name theme.Name) *Plot

Theme sets the visual theme.

func (*Plot) WriteTo

func (p *Plot) WriteTo(ctx context.Context, w io.Writer, format string, width, height int, opts ...RenderOpt) (int64, error)

WriteTo renders the plot and writes the output to w in the given format. Supported formats: "png" (default), "svg", "pdf". Options: WithScale for HiDPI output. Returns the number of bytes written.

Shorthand for Plot.Build followed by Built.WriteTo.

func (*Plot) XLim

func (p *Plot) XLim(lo, hi float64) *Plot

XLim sets explicit x-axis limits. Pass math.NaN() for either end to auto-detect.

func (*Plot) YLim

func (p *Plot) YLim(lo, hi float64) *Plot

YLim sets explicit y-axis limits. Pass math.NaN() for either end to auto-detect.

type PlotSpec added in v0.0.4

type PlotSpec struct {
	// Dataset is the primary data source.
	Dataset dataset.Dataset

	// GlobalMapping maps aesthetic channels to column names at the plot level.
	// Per-layer mappings override these.
	GlobalMapping AesMap

	// Layers describes each visual layer (geom + stat + position + local aes).
	Layers []LayerSpec

	// ScaleOverrides holds user-specified scale configurations, keyed by
	// aesthetic channel ("x", "y", "color", etc.).
	ScaleOverrides map[string]ScaleOverride

	// ColorScales holds user-specified color/fill scales, keyed by
	// aesthetic channel ("color" or "fill"). nil entries fall back to
	// the auto-detected default ([colormap.Viridis] for continuous data,
	// [colormap.Tab10] for discrete data).
	ColorScales map[string]*colormap.Scale

	// Coord defines the coordinate system (default: Cartesian).
	Coord coord.Coord

	// Facet defines the faceting strategy (default: None).
	Facet facet.Facet

	// Theme holds the theme name or configuration.
	ThemeName theme.Name

	// Labels holds plot title, subtitle, axis labels, caption.
	Labels Labels

	// XLim and YLim hold optional user-specified axis limits.
	// nil means auto-detect from data.
	XLim [2]*float64
	YLim [2]*float64

	// LegendPosition controls where the legend is drawn.
	LegendPosition string
}

PlotSpec is the fully declarative specification of a plot, produced by the user-facing builder API and consumed by the compilation pipeline.

type RenderOpt

type RenderOpt func(*renderConfig)

RenderOpt configures rendering output (scale, DPI, etc.).

func WithScale

func WithScale(s float64) RenderOpt

WithScale sets the DPI scale factor for rendering. scale=2.0 produces retina-resolution output (2× pixel density).

type ScaleOverride added in v0.0.4

type ScaleOverride struct {
	Type   scale.Type        // e.g., scale.Log10, scale.Sqrt, scale.Reverse
	Params map[string]string // type-specific parameters
	Opts   []scale.Opt       // functional options (WithBreaks, WithLabels, etc.)
}

ScaleOverride captures a user-requested scale for a specific aesthetic channel.

Directories

Path Synopsis
Package aes provides aesthetic mapping constructors for the Grammar of Graphics.
Package aes provides aesthetic mapping constructors for the Grammar of Graphics.
Package canvas defines the rendering backend abstraction.
Package canvas defines the rendering backend abstraction.
Package colormap provides a matplotlib-style colormap and color-scale API for the ggplot grammar of graphics pipeline.
Package colormap provides a matplotlib-style colormap and color-scale API for the ggplot grammar of graphics pipeline.
Package coord defines coordinate systems that control how data positions are mapped to the 2D plotting surface.
Package coord defines coordinate systems that control how data positions are mapped to the 2D plotting surface.
Package dataset provides columnar data abstractions for the Grammar of Graphics pipeline.
Package dataset provides columnar data abstractions for the Grammar of Graphics pipeline.
arrow
Package arrow provides an Apache Arrow-backed compute engine for the dataset package.
Package arrow provides an Apache Arrow-backed compute engine for the dataset package.
bigquery
Package bigquery implements a BigQuery SQL pushdown engine for the dataset library.
Package bigquery implements a BigQuery SQL pushdown engine for the dataset library.
compute
Package compute provides portable SIMD primitives for the dataset engines.
Package compute provides portable SIMD primitives for the dataset engines.
csv
Package csv provides CSV reading and writing for the dataset package.
Package csv provides CSV reading and writing for the dataset package.
math
Package math provides SIMD-accelerated mathematical transforms for the dataset engines.
Package math provides SIMD-accelerated mathematical transforms for the dataset engines.
memory
Package memory provides a lightweight Go-slice-backed compute engine for the dataset package.
Package memory provides a lightweight Go-slice-backed compute engine for the dataset package.
parquet
Package parquet provides Parquet reading and writing for the dataset package.
Package parquet provides Parquet reading and writing for the dataset package.
sort
Package sort provides SIMD-accelerated sorting for the dataset engines.
Package sort provides SIMD-accelerated sorting for the dataset engines.
examples
annotations command
Example: Reference lines and text annotations.
Example: Reference lines and text annotations.
butterfly command
Example: Butterfly curve with continuous color gradient.
Example: Butterfly curve with continuous color gradient.
categorical command
Example: Boxplot and Categorical (Discrete) X Axis
Example: Boxplot and Categorical (Discrete) X Axis
clifford command
Example: (Clifford[https://paulbourke.net/fractals/clifford/] attractor with continuous color gradient.
Example: (Clifford[https://paulbourke.net/fractals/clifford/] attractor with continuous color gradient.
color_mapping command
Example: Multi-Group Scatter with Colour Mapping and Legend
Example: Multi-Group Scatter with Colour Mapping and Legend
coord_flip command
Example: Orientation — every geometry flipped to horizontal.
Example: Orientation — every geometry flipped to horizontal.
geometries/area command
Example area demonstrates the geom.area geometry.
Example area demonstrates the geom.area geometry.
geometries/bar command
Example bar demonstrates the geom.bar geometry.
Example bar demonstrates the geom.bar geometry.
geometries/histogram command
Example histogram demonstrates the geom.histogram geometry.
Example histogram demonstrates the geom.histogram geometry.
geometries/line command
Example line demonstrates the geom.line geometry.
Example line demonstrates the geom.line geometry.
geometries/point command
Example point demonstrates the geom.point geometry.
Example point demonstrates the geom.point geometry.
geometries/smooth command
Example smooth demonstrates the geom.smooth geometry.
Example smooth demonstrates the geom.smooth geometry.
multiline command
Example: Multi-Line Plot
Example: Multi-Line Plot
phase2_features command
Phase 2: Coordinates, Faceting, Themes, Guides, Aesthetics, LegendPosition
Phase 2: Coordinates, Faceting, Themes, Guides, Aesthetics, LegendPosition
phase2_geometries command
Phase 2: Geometries — Point, Line, Step, Bar, Histogram, Area, Density, Rug, HLine, VLine, Text, BoxPlot, Smooth
Phase 2: Geometries — Point, Line, Step, Bar, Histogram, Area, Density, Rug, HLine, VLine, Text, BoxPlot, Smooth
phase2_scales command
Phase 2: Scales — Linear, Log10, Sqrt, Reverse, Discrete
Phase 2: Scales — Linear, Log10, Sqrt, Reverse, Discrete
phase2_statistics command
Phase 2: Statistics — Identity, Bin/Count, Density (KDE), Smooth (LOESS), Summary, BoxPlot
Phase 2: Statistics — Identity, Bin/Count, Density (KDE), Smooth (LOESS), Summary, BoxPlot
phase4_pipeline command
Phase 4 Pipeline: System Columns (PANEL, group) & Position Adjustments
Phase 4 Pipeline: System Columns (PANEL, group) & Position Adjustments
reference_lines command
Reference Lines — HLine, VLine, and ABLine examples.
Reference Lines — HLine, VLine, and ABLine examples.
scale_config command
Phase 5a: Scale Configuration — Breaks, Labels, Formatter, Expand, MinorBreaks, and ClipBounds.
Phase 5a: Scale Configuration — Breaks, Labels, Formatter, Expand, MinorBreaks, and ClipBounds.
showcase command
Example: Feature Showcase
Example: Feature Showcase
themes command
Example: Theme Showcase
Example: Theme Showcase
Package facet splits a dataset into subsets for "small multiple" panel layouts.
Package facet splits a dataset into subsets for "small multiple" panel layouts.
Package fonts provides a cross-platform, pure-Go typography subsystem.
Package fonts provides a cross-platform, pure-Go typography subsystem.
Package geom provides geometry specifications for the Grammar of Graphics.
Package geom provides geometry specifications for the Grammar of Graphics.
Package output provides rendering output abstractions for exporting and displaying plots.
Package output provides rendering output abstractions for exporting and displaying plots.
Package position defines position adjustments that control how overlapping geometries are arranged.
Package position defines position adjustments that control how overlapping geometries are arranged.
Package scale provides scale transformations that map data values to visual aesthetic values.
Package scale provides scale transformations that map data values to visual aesthetic values.
Package stat provides statistical transformations for the Grammar of Graphics.
Package stat provides statistical transformations for the Grammar of Graphics.
Package theme provides visual styling configurations for plots.
Package theme provides visual styling configurations for plots.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL