Skip to content

inherit.aes ignored in geom_{ab,h,v}line #2696

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

Closed
adrfantini opened this issue Jun 13, 2018 · 5 comments · Fixed by #3173
Closed

inherit.aes ignored in geom_{ab,h,v}line #2696

adrfantini opened this issue Jun 13, 2018 · 5 comments · Fixed by #3173

Comments

@adrfantini
Copy link

adrfantini commented Jun 13, 2018

The documentation for geom_abline says that inherit.aes is a valid parameter for this geom: If specified and inherit.aes = TRUE (the default)..., but it seems not: Warning: Ignoring unknown parameters: inherit.aes:

Example:

p <- ggplot(mtcars, aes(wt, mpg)) + geom_point()

# Fixed values
p + geom_vline(xintercept = 5)
p + geom_vline(xintercept = 5, inherit.aes = TRUE)
#Warning: Ignoring unknown parameters: inherit.aes
@ppanko
Copy link
Contributor

ppanko commented Mar 4, 2019

Seems like this is a case of a now-defunct behavior changed in #482. inherit.aes is no longer passed to layer, it is instead hard-coded to FALSE. The documentation for geom_*line may need to be updated to reflect this.

@yutannihilation
Copy link
Member

This is purely a documentation issue, and it seems fixed now; inherit.aes no more exists in the documentation of geom_abline() and the reason is explained clearly:

Unlike most other geoms, these geoms do not inherit aesthetics from the plot default, because they do not understand x and y aesthetics which are commonly set in the plot. They also do not affect the x and y scales.

@karawoo
Copy link
Member

karawoo commented Mar 4, 2019

It does still exist in the documentation of the mapping parameter, which comes before the disclaimer about these geoms not inheriting aesthetics.

Set of aesthetic mappings created by aes() or aes_(). If specified and inherit.aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping.

Maybe we should document mapping explicitly here instead of relying on @inheritParams for these geoms.

@yutannihilation
Copy link
Member

Ah, true. Sorry...

@lock
Copy link

lock bot commented Sep 1, 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 Sep 1, 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 a pull request may close this issue.

4 participants