Skip to content

geom_area with negative y not working in ggplot2 3.2.0 #3390

Closed
@vadimus202

Description

@vadimus202

In ggplot2 3.1.1 the area under the curve handles negative values

library(ggplot2)

set.seed(115)

ggplot(
    data.frame(
        x = 1:100,
        y = cumsum(rnorm(n = 100, mean = 0, sd = 3))
    ),
    aes(x, y)) +
    geom_area(fill = "pink", alpha = 0.5) +
    geom_path()

image

In ggplot2 3.2.0 something goes wrong:

library(ggplot2)

set.seed(115)

ggplot(
    data.frame(
        x = 1:100,
        y = cumsum(rnorm(n = 100, mean = 0, sd = 3))
    ),
    aes(x, y)) +
    geom_area(fill = "pink", alpha = 0.5) +
    geom_path()

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorlayers 📈

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions