Skip to content

Default parameter change for outline.type of geom_density in new version of ggplot2 #6531

Closed
@Breeze-Hu

Description

@Breeze-Hu

Hi !
I was using ggplot2 version 3.5.2.9000 for geom_density plotting and noticed a change in the default behavior (by default a horizontal line is plotted underneath). 3.5.2 vs 3.5.2.9000 is shown below:


https://ggplot2.tidyverse.org/dev/reference/geom_density.html

Image

https://ggplot2.tidyverse.org/reference/geom_density.html
Image

3.5.2.9000 version, the default value is: both

geom_density(
  mapping = NULL,
  data = NULL,
  stat = "density",
  position = "identity",
  ...,
  lineend = "butt",
  linejoin = "round",
  linemitre = 10,
  outline.type = "both",
  na.rm = FALSE,
  show.legend = NA,
  inherit.aes = TRUE
)

I have a feeling the change started in this neighborhood:
a7371db#diff-df3d6442fc530b8506c6e81d1b8b30a4abc665d334c2c86afe5be60611656770

GeomDensity <- ggproto(
  "GeomDensity", GeomArea,
  default_aes = aes(
    colour = from_theme(colour %||% ink),
    fill   = from_theme(fill %||% NA),
    weight = 1,
    alpha  = NA,
    linewidth = from_theme(borderwidth),
    linetype  = from_theme(bordertype)
  )
)

I'm not sure if the change was made intentionally or if it was an unintentional mistake, if it was an intentional change, please feel free to close this issue. hopefully I didn't bring too many extraneous interruptions.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions