Skip to content

Facet titles #974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2015
Merged

Facet titles #974

merged 1 commit into from
Jun 18, 2015

Conversation

lionel-
Copy link
Member

@lionel- lionel- commented Jun 15, 2014

This implements a switch_strips argument to facet_wrap and facet_grid, which can be set to x, y or both (the latter only for grids). This allows to display the facet strips near the axes. They then act as axes subtitles. The padding between the switched strips and their corresponding axes can be adjusted through a new theme setting.

Displaying the facet titles near the axes especially makes sense when the facet title directly characterize a change in the axis (for example, a transformation, a different measure, etc). This should be typically used in conjunction with a theme without boxes around the strips. I go over this in the updated documentation.

A grid facetting with strips switched to both axes:
facet1

A wrap facetting with free scales and strips switched to the x axis:
facet2

@hadley
Copy link
Member

hadley commented Jun 11, 2015

I like the idea. Can you please re-document and merge/rebase so I can do a review on cleaner code? (A bit of commit squashing wouldn't hurt either)

@lionel- lionel- force-pushed the facet-titles branch 2 times, most recently from efaa6b5 to c6583c1 Compare June 13, 2015 19:17
@lionel-
Copy link
Member Author

lionel- commented Jun 13, 2015

Here you go.

@@ -174,6 +174,10 @@ print.theme <- function(x, ...) str(x)
#' (\code{element_text}; inherits from \code{strip.text}) \cr
#' strip.text.y \tab facet labels along vertical direction
#' (\code{element_text}; inherits from \code{strip.text}) \cr
#' strip.switch.pad.grid \tab space between strips and axes when strips are switched
#' (\code{unit} \cr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing parens?

@hadley
Copy link
Member

hadley commented Jun 18, 2015

Overall, looks good. A few minor nit-picks inline.

@lionel-
Copy link
Member Author

lionel- commented Jun 18, 2015

voilà

as axes subtitles. Can be set to "x", "y" or "both" (the latter only
for grids) to control which label strips are switched. (@lionel-)

* `Geom` is now exported, making it easier to create new geoms in other
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This got messed up, but I can fix it.

hadley added a commit that referenced this pull request Jun 18, 2015
@hadley hadley merged commit 2c631d5 into tidyverse:master Jun 18, 2015
@hadley
Copy link
Member

hadley commented Jun 18, 2015

Thanks! People are really going to like this feature

@lock
Copy link

lock bot commented Jan 18, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants