From 85f95d910aad1f9ea5c6dcf5b6e7e8918999e936 Mon Sep 17 00:00:00 2001 From: Deepak Singh Date: Thu, 19 Mar 2026 09:34:54 +0000 Subject: [PATCH] feat: add 'plot.sticky' RC flag to toggle sticky edges (closes #631) Added a new 'plot.sticky' configuration setting (default True) that allows globally disabling sticky edges for line and area plots via the rc file or rc context. --- ultraplot/axes/plot.py | 2 ++ ultraplot/internals/rcsetup.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/ultraplot/axes/plot.py b/ultraplot/axes/plot.py index a4388d3d3..066163e85 100644 --- a/ultraplot/axes/plot.py +++ b/ultraplot/axes/plot.py @@ -3497,6 +3497,8 @@ def _fix_sticky_edges(self, objs, axis, *args, only=None): Fix sticky edges for the input artists using the minimum and maximum of the input coordinates. This is used to copy `bar` behavior to `area` and `lines`. """ + if not rc["plot.sticky"]: + return for array in args: min_, max_ = inputs._safe_range(array) if min_ is None or max_ is None: diff --git a/ultraplot/internals/rcsetup.py b/ultraplot/internals/rcsetup.py index 3b94e8ec0..969f6649b 100644 --- a/ultraplot/internals/rcsetup.py +++ b/ultraplot/internals/rcsetup.py @@ -1050,6 +1050,12 @@ def _validator_accepts(validator, value): _validate_float, "Vertical margin around ribbon diagrams (axes-relative units).", ), + # Plot settings + "plot.sticky": ( + True, + _validate_bool, + "Whether to use sticky edges for line and area plots by default.", + ), "ribbon.rowheightratio": ( 2.2, _validate_float,