Skip to content

Fix bug: Fill aesthetic does not show in the legend guide for stat_summary #1978

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
wants to merge 9 commits into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented Jan 2, 2017

Hi. I read this bug: #1546
Fill aesthetic does not show in the legend guide for stat_summary
And i want to contribute for its solution.
The results:

# using default summary function fill in the legend 
ggplot(mtcars, aes(cyl ,mpg,col=factor(am),fill=factor(am))  )+
  geom_point()+
  stat_summary(aes(cyl,mpg), geom = "smooth")

rplot01

# without the parameter "geom=smooth" no fill in the legend 
ggplot(mtcars, aes(cyl ,mpg,col=factor(am),fill=factor(am))  )+
  geom_point()+
  stat_summary()

rplot02

# geom smooth with parameter "se=FALSE" no fill in the legend.
ggplot(mtcars, aes(cyl,mpg,col=factor(am),fill=factor(am))  )+
  geom_point()+
  geom_smooth(se=FALSE)

rplot03

@hadley
Copy link
Member

hadley commented Jan 3, 2017

Can you please:

  • Rebase against master so that you get the existing travis fix
  • Remove the appyveyor file
  • Change the title of the pull request to describe the issue
  • Include closes #1546 in one of the commit messages

I'll do a more detailed code review after that

Rebase against master so that you get the existing travis fix
@ghost ghost changed the title Fix bug #1546 Proposal for fix bug #1546 Jan 7, 2017
@ghost
Copy link
Author

ghost commented Jan 8, 2017

Excuse me for my delay. Your requirements are ready.

@hadley
Copy link
Member

hadley commented Jan 24, 2017

Can you please update the title of this PR (and your others) to be informative. I don't know the indices of the ggplot2 bugs off the top of my head.

@ghost ghost changed the title Proposal for fix bug #1546 Fix bug #1546: Fill aesthetic does not show in the legend guide for stat_summary Jan 25, 2017
@ghost
Copy link
Author

ghost commented Jan 25, 2017

Your requirements are ready again.

@hadley
Copy link
Member

hadley commented Jan 25, 2017

You don't need to repeat the bug name in the PR title. Just write it as the positive statement, e.g. "Show fill in the legend for stat_summary"

@ghost ghost changed the title Fix bug #1546: Fill aesthetic does not show in the legend guide for stat_summary Fix bug: Fill aesthetic does not show in the legend guide for stat_summary Jan 25, 2017
@ghost
Copy link
Author

ghost commented Jan 25, 2017

Ready!

Copy link
Member

@hadley hadley left a comment

Choose a reason for hiding this comment

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

Can you please also add a bullet to NEWS describing this change?

.travis.yml Outdated
@@ -8,6 +8,9 @@ r_github_packages:
after_success:
- Rscript -e 'covr::codecov()'

before_install:
Copy link
Member

Choose a reason for hiding this comment

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

Can you please delete this?

R/legend-draw.r Outdated
@@ -159,7 +159,7 @@ draw_key_smooth <- function(data, params, size) {
data$alpha <- 1

grobTree(
if (isTRUE(params$se)) rectGrob(gp = gpar(col = NA, fill = data$fill)),
if (isTRUE(params$se) | is.null(params$se)) rectGrob(gp = gpar(col = NA, fill = data$fill)),
Copy link
Member

Choose a reason for hiding this comment

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

This should be || and not |

@hadley
Copy link
Member

hadley commented Jul 13, 2017

@Emanuelcontreras are you interested in finishing this off?

@ghost

This comment has been minimized.

@clauswilke
Copy link
Member

Closing this PR. The issue was resolved via #2567.

@clauswilke clauswilke closed this May 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants