HMPlot

ordinal

A scale from ordered categories to colors along a colormap.

rank = hm.ordinal(domain=["Low", "Middle", "High"], colormap="Viridis")
hm.Points(fill="rank", fill_scale=rank)

Parameters

domaincategory[]
The categories in order.
colormapstring | color[]
The colormap the categories are spread along (default Viridis).
rangecolor[]
Explicit colors instead of a colormap.
unknowncolor
The color of other categories.
labelstring
The legend's title.

Usage

Unlike an unordered categorical palette, an ordinal colormap communicates rank. Supply the category order explicitly; category values are not numerically interpolated.