Skip to content

Add the strip_placement theme element#1089

Merged
has2k1 merged 15 commits into
mainfrom
strip-placement
Jun 25, 2026
Merged

Add the strip_placement theme element#1089
has2k1 merged 15 commits into
mainfrom
strip-placement

Conversation

@has2k1

@has2k1 has2k1 commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Adds the strip_placement theme element, which controls how a facet strip and a moved axis share a side. When a facet strip and an axis (e.g. scale_x_continuous(position="top")) land on the same side, strip_placement chooses their order, from the panel outward:

(
    ggplot(mtcars, aes("wt", "mpg")) + geom_point()
    + facet_wrap("cyl") + scale_x_continuous(position="top")
    + theme(strip_placement="outside")
)

has2k1 added 15 commits June 23, 2026 19:27
…e offset

For strip_placement=outside the strip now clears only the axis ticks and
labels, sitting before the axis title rather than beyond it; the title
shifts out past the strip. The shared band is ordered ticks+labels, strip,
title from the panel outward.

The moved axis is shifted by repositioning its spine outward. This avoids
Spine.set_position's axis.reset_ticks(), which regenerates the ticks and
drops the theme's per-tick styling (tick label colour and font, blanked
minor marks). Instead the existing tick marks are re-pointed at the moved
spine transform; the labels are positioned by the layout.
@has2k1
has2k1 merged commit 8e3680c into main Jun 25, 2026
14 checks passed
@has2k1
has2k1 deleted the strip-placement branch June 25, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant