mjskay / ggdist

Visualizations of distributions and uncertainty
https://mjskay.github.io/ggdist/
GNU General Public License v3.0
854 stars 26 forks source link

Unable to override aesthetics for legend keys #188

Closed steveharoz closed 1 year ago

steveharoz commented 1 year ago

Overriding the legend key aesthetics works fine with geom_dotplot(), but it doesn't work for geom_dots().

# points in the legend are small by default
ggplot(mtcars) + 
  aes(x=wt, fill=factor(cyl)) + 
  geom_dotplot(method = "histodot", stackgroups = TRUE)

image

ggplot(mtcars) + 
  aes(x=wt, fill=factor(cyl)) + 
  geom_dotplot(method = "histodot", stackgroups = TRUE) + 
  # Override the point size!
  guides(fill = guide_legend(override.aes = list(size=20)))

image

But with geom_dots(), the override doesn't work.

ggplot(mtcars) + 
  aes(x=wt, fill=factor(cyl), group=1) + 
  ggdist::geom_dots() + 
  # doesn't work :(
  guides(fill = guide_legend(override.aes = list(size=20)))

image

Might be related to #134

mjskay commented 1 year ago

oh yeah, try it now on the github version, should be fixed for geom_dots().

steveharoz commented 1 year ago

Awesome. Thanks!