Skip to content

Commit 5fed129

Browse files
committed
feat(theme): add strip_switch_pad themeables and default
1 parent 3f63b24 commit 5fed129

4 files changed

Lines changed: 46 additions & 0 deletions

File tree

doc/_quartodoc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,9 @@ quartodoc:
520520
- strip_background_x
521521
- strip_background_y
522522
- strip_placement
523+
- strip_switch_pad
524+
- strip_switch_pad_x
525+
- strip_switch_pad_y
523526
- strip_text
524527
- strip_text_x
525528
- strip_text_x_bottom

plotnine/themes/theme.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ def __init__(
245245
strip_align_x=None,
246246
strip_align_y=None,
247247
strip_align=None,
248+
strip_switch_pad_x=None,
249+
strip_switch_pad_y=None,
250+
strip_switch_pad=None,
248251
strip_placement=None,
249252
svg_usefonts=None,
250253
**kwargs,

plotnine/themes/theme_gray.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def __init__(self, base_size=11, base_family=None):
145145
plot_tag_location="margin",
146146
plot_tag_position="topleft",
147147
strip_align=0,
148+
strip_switch_pad=base_size / 4,
148149
strip_placement="inside",
149150
strip_background=element_rect(color="none", fill="#D9D9D9"),
150151
strip_background_x=element_rect(width=1),

plotnine/themes/themeable.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2865,6 +2865,45 @@ class strip_align(strip_align_x, strip_align_y):
28652865
"""
28662866

28672867

2868+
class strip_switch_pad_x(themeable):
2869+
"""
2870+
Space between an x-axis and a strip placed beyond it on the same side
2871+
2872+
Parameters
2873+
----------
2874+
theme_element : float
2875+
Size in points. Only has an effect when
2876+
`strip_placement="outside"` and an axis shares the strip's
2877+
side (top or bottom).
2878+
"""
2879+
2880+
2881+
class strip_switch_pad_y(themeable):
2882+
"""
2883+
Space between a y-axis and a strip placed beyond it on the same side
2884+
2885+
Parameters
2886+
----------
2887+
theme_element : float
2888+
Size in points. Only has an effect when
2889+
`strip_placement="outside"` and an axis shares the strip's
2890+
side (left or right).
2891+
"""
2892+
2893+
2894+
class strip_switch_pad(strip_switch_pad_x, strip_switch_pad_y):
2895+
"""
2896+
Space between an axis and a strip placed beyond it on the same side
2897+
2898+
Parameters
2899+
----------
2900+
theme_element : float
2901+
Size in points. Only has an effect when
2902+
`strip_placement="outside"` and an axis shares the strip's
2903+
side.
2904+
"""
2905+
2906+
28682907
class strip_placement(themeable):
28692908
"""
28702909
Where a facet strip sits relative to an axis on the same side

0 commit comments

Comments
 (0)