Add the strip_placement theme element#1089
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_placementchooses 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") )