From 737611ec864be468e9b1084d6eacfa325f44a4bc Mon Sep 17 00:00:00 2001 From: Hassan Kibirige Date: Thu, 19 Sep 2024 16:40:46 +0300 Subject: [PATCH] Allow mapping aesthetic to None closes #791 --- doc/changelog.qmd | 2 ++ plotnine/mapping/evaluation.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/changelog.qmd b/doc/changelog.qmd index 0bf2188c8..bde3167a2 100644 --- a/doc/changelog.qmd +++ b/doc/changelog.qmd @@ -39,6 +39,8 @@ title: Changelog by giving them no shape, now they do not affect the limits of the plot. ({{< issue 814 >}}) +- Made it possile to map an aesthetic value to `None`. ({{< issue 791 >}}) + ### New Features - [](:class:`~plotnine.geom_text`) has gained new aesthetics diff --git a/plotnine/mapping/evaluation.py b/plotnine/mapping/evaluation.py index a8162197c..73adb751e 100644 --- a/plotnine/mapping/evaluation.py +++ b/plotnine/mapping/evaluation.py @@ -242,7 +242,7 @@ def evaluate( ) raise PlotnineError(msg) evaled[ae] = col - elif is_known_scalar(col): + elif is_known_scalar(col) or col is None: if not len(evaled): col = [col] evaled[ae] = col