Skip to content

Document all themes together #933

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 3 commits into from
Mar 21, 2014
Merged

Document all themes together #933

merged 3 commits into from
Mar 21, 2014

Conversation

jiho
Copy link
Contributor

@jiho jiho commented Mar 18, 2014

Add a slightly more detailed description of the themes and a few words
about their intent. Add examples to ease comparison.

jiho added 2 commits March 18, 2014 01:26
Add a slightly more detailed description of the themes and a few words about their intent.
Add examples to ease comparison
@jiho
Copy link
Contributor Author

jiho commented Mar 18, 2014

I'm not sure about the documentation of the "intent" of each theme. Please feel free to ask for any change.

@jiho
Copy link
Contributor Author

jiho commented Mar 18, 2014

Also, shouldn't theme_minimal have no grid lines either? (it is what I would expect from a theme with no "background annotations").

@jiho
Copy link
Contributor Author

jiho commented Mar 18, 2014

Finally, I really find the facet strips in theme_bw and theme_minimal quite inelegant, not fitting with the rest of ggplot. The examples make that clearer. Couldn't that, at least, be "fixed" by removing either the fill or the outline depending on the theme?

theme_light <- function(base_size = 12, base_family = "") {
# Starts with theme_grey and then modify some parts
theme_grey(base_size = base_size, base_family = base_family) %+replace%
theme(
axis.ticks = element_line(colour = "grey50", size = 0.25),
axis.ticks = element_line(colour = "grey70", size = 0.25),
Copy link
Member

Choose a reason for hiding this comment

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

Were these changes deliberate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes they are. Documenting the functions together made it easier to compare them and it this theme needed to be a little lighter to better differentiate it from others.

@hadley
Copy link
Member

hadley commented Mar 18, 2014

This looks like it would be a perfect use case for the new @describeIn tag. e.g. in theme_grey(), put #' @describeIn ggtheme The signature ggplot2 theme with a grey background ...

@hadley
Copy link
Member

hadley commented Mar 18, 2014

I'm happy for tweaks to theme_bw() and theme_minimal() but they'll need to be carefully thought out to avoid breaking existing expectation.

#' @aliases theme_gray theme_grey
#' @export theme_gray theme_grey
#' @family themes
#' @rdname ggtheme
Copy link
Member

Choose a reason for hiding this comment

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

For symmetry, I think it would be better to do

#' @name ggtheme
NULL

#' @export
#' @rdname ggtheme
theme_bw <- ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Except that doing it this way make roxygen think ggtheme is a data type and using @describeIn complains: Don't know how to describe function in data.

Any advice?

Copy link
Member

Choose a reason for hiding this comment

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

Good point. Not sure how to make this work my way - stick with your way.

Make all themes symmetrically reference the general ggtheme documentation
Document theme_grey and theme_gray
@jiho
Copy link
Contributor Author

jiho commented Mar 21, 2014

The documentation is now done.
I've put the tweaks to themes in a separate pull-request #934 .

hadley added a commit that referenced this pull request Mar 21, 2014
Document all themes together
@hadley hadley merged commit 5d16382 into tidyverse:master Mar 21, 2014
@hadley
Copy link
Member

hadley commented Mar 21, 2014

Thanks!

@jiho jiho deleted the theme_doc branch March 21, 2014 16:39
@lock
Copy link

lock bot commented Jan 19, 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 19, 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