Skip to content

New theme option to put panel/grid on top of data #993

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 4 commits into from
Jun 18, 2015

Conversation

noamross
Copy link
Contributor

@noamross noamross commented Aug 6, 2014

A new theme option, panel.ontop, places the background objects (panel, gridlines), on top of the
data in the plot if set to TRUE. This allows one to place gridlines over the data. One would typically also include a blank or transparent panel in the theme.

This is implemented by changes in facet_panels.* functions, changing the ordering of layers depending on the value of theme$panel.ontop. add_theme was also changed to allow for logical theme elements.

This is a simple implementation. A more advanced one would allow gridlines to be placed on top of data while keeping the panel below data.

Updated theme() documentation included via roxygen 4.0.1.

Tests passed with the following exception. which I believe is unrelated:

Stats : .Error in predLoess(y, x, newx, s, weights, pars$robust, pars$span, pars$degree,  : 
  NA/NaN/Inf in foreign function call (arg 5)
In addition: Warning message:
In max(panels$ROW) : no non-missing arguments to max; returning -Inf

Fixes #551

@@ -423,7 +426,7 @@ add_theme <- function(t1, t2, t2name) {
# If x is NULL or element_blank, then just assign it y
x <- y
} else if (is.null(y) || is.character(y) || is.numeric(y) ||
inherits(y, "element_blank")) {
is.logical(y) || inherits(y, "element_blank")) {
Copy link
Member

Choose a reason for hiding this comment

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

What's this change related to?

@hadley
Copy link
Member

hadley commented Jun 11, 2015

Looks good. Could you please

  • merge/rebase (paying particular attention to NEWS)
  • re-roxygenise
  • add a compelling example somewhere?

noamross added 3 commits June 12, 2015 13:26
Merge remote-tracking branch 'hadley/master' into feature/panel_on_top

Conflicts:
	man/theme.Rd
hadley added a commit that referenced this pull request Jun 18, 2015
New theme option to put panel/grid on top of data
@hadley hadley merged commit efd3cbd into tidyverse:master Jun 18, 2015
@hadley
Copy link
Member

hadley commented Jun 18, 2015

Thanks!

@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.

Allow to draw gridlines on top of data
2 participants