Skip to content

Fill aesthetic does not show in the legend guide for stat_summary #1546

Closed
@smouksassi

Description

@smouksassi
require(ggplot2)

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

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

# geom smooth shows the fill in the legend which is the expected behavior
ggplot(mtcars, aes(cyl,mpg,col=factor(am),fill=factor(am))  )+
  geom_point()+
  geom_smooth()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorscales 🐍

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions