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 Plotting 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.
Bases: matplotlib.units.ConversionInterface
Set the default axis ticks and labels.
Convert strings in value to floats using mapping information stored in the unit object.
Bases: matplotlib.ticker.Formatter
String representation of the data at every tick.
Mapping of category names (str) to indices (int).
Return the tick labels for all the ticks at once.
Bases: matplotlib.ticker.Locator
Tick at every integer mapping of the string data.
Mapping of category names (str) to indices (int).
Return the values of the located ticks given vmin and vmax.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated axis
simply call the Locator instance:
>>> print(type(loc)) <type 'Locator'> >>> print(loc()) [1, 2, 3, 4]
Bases: object
Create mapping between unique categorical values and integer ids.
sequence of string values
Map new values to integer identifiers.
If elements in data are neither str nor bytes.
© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.5.1/api/category_api.html