-
Notifications
You must be signed in to change notification settings - Fork 2.1k
added fill to gpar in geom_curve() #2375
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
Conversation
R/geom-curve.r
Outdated
@@ -38,6 +38,7 @@ geom_curve <- function(mapping = NULL, data = NULL, | |||
#' @usage NULL | |||
#' @export | |||
GeomCurve <- ggproto("GeomCurve", GeomSegment, | |||
default_aes = aes(colour = "black", fill = "black", size = 0.5, linetype = 1, alpha = NA), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can omit this since it will be inherited from geom_segment()
Can you please add a bullet to NEWS? It should briefly describe the change (starting with name of the function), and crediting yourself with I think this is a slight change to behaviour? i.e. if you had arrows and mapped the colour to a variable, the arrows will now be black instead of coloured? |
It is a change in behavior, and on further reflection making the arrow fill an aesthetic may cause problems for some. First, under the old behavior Second, the question is whether the arrow head should take the color of Unless @hrbrmstr beats me to it, I can address this towards the end of the week. Not today, unfortunately. |
For now, I'd prefer to make this a parameter of the geom, and then we can figure out how to make it an aesthetic post-2345. |
So, it'd be a parameter that is set to |
Exactly - you can just copy what |
Aye. I'll make all those changes later today and also mod the docs + NEWS |
and, for good measure
|
Roxygen docs were also updated as well as the |
NEWS.md
Outdated
@@ -48,6 +48,10 @@ | |||
* Added `stat_qq_line()` to make it easy to add a simple line to a Q-Q plot. This | |||
line makes it easier to judge the fit of the theoretical distribution | |||
(@nicksolomon). | |||
|
|||
* Added `arrow.fill` parameter to `geom_segment()` and `geom_curve()` to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please rewrite so the function names come first? (And then use that to alphabetise within this list of changes?)
(Normally I do that just before release but this release has been dragging on because I haven't found the time to finish it off)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Thanks! |
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/ |
Based on https://stackoverflow.com/questions/47878787/fill-arrow-on-geom-curve-ggplot2/47879776#47879776
this adds a missing
fill
gpar
(i.e. back on par withgeom_segment
) and takes care of ^^ issue.I also added the
fill
aesthetic togeom_segment()
and changed thefill
there to use it.this means the arrows can be filled in for both.
NOTE: @clauswilke had the idea to add the fill aesthetic to
geom_curve
and I figuredgeom_segment
shldn't be left out.