Palettes
Sequential color ramps
Sequential ramps encode continuous fill. Categorical schemes color discrete series — see Color palettes.
Scheme names as scale inputs: Palettes reference. How to set a ramp on a plot: ScaleColorContinuous. Narrative guide: Scales and guides.
viridismagmaplasmainfernocividisturboBluesGreensRedsOrangesPurplesGreysYlOrRdYlGnBuBuPuRdYlBuRdBuBrBGSpectralPuOrtableau_seq_blue_greentableau_seq_blue_lighttableau_seq_orange_lighttableau_seq_bluetableau_seq_orangetableau_seq_greentableau_seq_redtableau_seq_purpletableau_seq_browntableau_seq_graytableau_seq_gray_warmtableau_seq_blue_tealtableau_seq_orange_goldtableau_seq_green_goldtableau_seq_red_goldtableau_div_orange_bluetableau_div_red_greentableau_div_green_bluetableau_div_red_bluetableau_div_red_blacktableau_div_gold_purpletableau_div_red_green_goldtableau_div_sunset_sunrisetableau_div_orange_blue_whitetableau_div_red_green_whitetableau_div_green_blue_whitetableau_div_red_blue_whitetableau_div_red_black_whitetableau_div_orange_blue_lighttableau_div_temperature
Behavior
Read on the colorbar
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.
Reversed
Custom range
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>