Skip to content

High frequency sine waves by stat_function look improper #6413

Closed
@Close-your-eyes

Description

@Close-your-eyes

Why does stat_function or geom_function fail to plot high frequency sine waves properly?

reprex:
library(ggplot2)
plots <- purrr::map(c(1,2,3,4,5,seq(10,100,10)), function(y) {
ggplot(data.frame(x=seq(0,20,length.out=100)), aes(x)) +
stat_function(fun = ~sin(y*.x))
})
patchwork::wrap_plots(plots)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions