From 643bb223bf5708f584c3c98bf002be97ec4ff928 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Tue, 11 Feb 2025 09:25:37 +0100 Subject: [PATCH] DOC: Note that duplicate catergorial values are mapped to the same position I repurposed the existing example. It's natural and expected that categoricals also work on the y-axis, so I removed the explicit mentioning of this. Instead, the example already shows nicely how duplicate values are handled. --- .../examples/lines_bars_and_markers/categorical_variables.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/galleries/examples/lines_bars_and_markers/categorical_variables.py b/galleries/examples/lines_bars_and_markers/categorical_variables.py index 4cceb38fbd4d..a19a30eda2b2 100644 --- a/galleries/examples/lines_bars_and_markers/categorical_variables.py +++ b/galleries/examples/lines_bars_and_markers/categorical_variables.py @@ -20,7 +20,10 @@ # %% -# This works on both Axes: +# Categorical values are a mapping from names to positions. This means that +# values that occur multiple times are mapped to the same position. See the +# ``cat`` and ``dog`` values "happy" and "bored" on the y-axis in the following +# example. cat = ["bored", "happy", "bored", "bored", "happy", "bored"] dog = ["happy", "happy", "happy", "happy", "bored", "bored"]