Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All-zero category leads to empty plot #23

Open
salim-b opened this issue Apr 21, 2023 · 0 comments
Open

All-zero category leads to empty plot #23

salim-b opened this issue Apr 21, 2023 · 0 comments

Comments

@salim-b
Copy link

salim-b commented Apr 21, 2023

Description

When a category of the input time series data is always zero, ggstream fails to produce a plot.

Reproducible example

ggstream::blockbusters |>
    dplyr::mutate(box_office = dplyr::if_else(genre == "Action",
                                              0,
                                              box_office)) |>
    ggplot2::ggplot(mapping = ggplot2::aes(x = year,
                                           y = box_office,
                                           fill = genre)) +
    ggstream::geom_stream()

Created on 2023-04-21 with reprex v2.0.2

Expected result

I'd expect the example above to produce the same result as...

ggstream::blockbusters |>
    dplyr::filter(genre != "Action")|>
    ggplot2::ggplot(mapping = ggplot2::aes(x = year,
                                           y = box_office,
                                           fill = genre)) +
    ggstream::geom_stream()

...but with an additional legend entry for the Action category.

Created on 2023-04-21 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant