Palettes

Color palettes

Categorical schemes color discrete series. Sequential ramps encode continuous fill. Chart themes style paper and chrome separately — see Themes.

Sequential

Ramps

Continuous fill on a Macdonell man-count grid. Reverse, custom range, and pinned domain should read clearly on the colorbar — not only on a few cells.

  1. Viridis

  2. Reversed

  3. Custom range

  4. Pinned domain

Authoring fragment

<script lang="ts">
  import { GeomRaster, GGPlot, Labs, Scale } from "@ggsvelte/svelte";

  // Macdonell man-count grid (48 cells in the live demos).
  const grid = [
    { x: 0, y: 0, z: 12 },
    { x: 1, y: 0, z: 28 },
    { x: 2, y: 0, z: 41 },
    // …
  ];
</script>

<GGPlot
  data={grid}
  aes={{ x: "x", y: "y", fill: "z" }}
  height={400}
>
  <Scale
    value={{
      fill: { type: "sequential", scheme: "viridis" },
      // reverse: true
      // domain: [15, 40]  // pin inside actual man counts
      // range: ["#2d1e2f", "#3d5a80", "#e76f51"]
    }}
  />
  <Labs title="Macdonell stature × finger counts" x="Finger index" y="Height index" />
  <GeomRaster />
</GGPlot>