Skip to content

Mode calculated incorrectly #236

@fkohrt

Description

@fkohrt

The following code is supposed to display a spike at the density's mode, but that's apparently not the case.

data.frame(x = datasets::AirPassengers) |>
  ggplot2::ggplot(ggplot2::aes(x = x)) +
  ggdist::stat_slab(ggplot2::aes(height = max(ggplot2::after_stat(pdf)))) +
  ggdist::stat_spike(
    ggplot2::aes(height = max(ggplot2::after_stat(pdf))),
    at = ggdist::Mode
  )

Rplot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions