Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions plotnine/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ._utils import array_kind, check_required_aesthetics, ninteraction
from ._utils.registry import Registry
from .exceptions import PlotnineError
from .mapping.aes import NO_GROUP, SCALED_AESTHETICS, aes, make_labels
from .mapping.aes import NO_GROUP, aes, make_labels
from .mapping.evaluation import evaluate, stage

if typing.TYPE_CHECKING:
Expand Down Expand Up @@ -577,7 +577,12 @@ def add_group(data: pd.DataFrame) -> pd.DataFrame:
return data

if "group" not in data:
ignore = data.columns.difference(list(SCALED_AESTHETICS))
# Exclude some "special" aesthetics from contributing towards
# the grouping.
# label - geom_text, geom_label
# geometry - geom_map
# where - geom_ribbon
ignore = ["PANEL", "label", "geometry", "where"]
disc = discrete_columns(data, ignore=ignore)
if disc:
data["group"] = ninteraction(data[disc], drop=True)
Expand Down
Loading