matplotlib.category

Plotting of string “category” data: plot(['d', 'f', 'a'], [1, 2, 3]) will plot three points with x-axis values of ‘d’, ‘f’, ‘a’.

See /gallery/lines_bars_and_markers/categorical_variables for an example.

The module uses Matplotlib’s matplotlib.units mechanism to convert from strings to integers and provides a tick locator, a tick formatter, and the .UnitData class that creates and stores the string-to-integer mapping.