Skip to content

Regression related to #5807 #6009

@teunbrand

Description

@teunbrand

Using width = NULL used to work, but it no longer does since we changed it from a parameter to an aesthetic.
Should we just warn + ignore 0-length aesthetics instead of throwing errors?

library(ggplot2)

ggplot(mpg, aes(drv)) +
  geom_bar(width = NULL)

# Load current main branch
devtools::load_all("~/packages/ggplot2/")
#> ℹ Loading ggplot2

ggplot(mpg, aes(drv)) +
  geom_bar(width = NULL)
#> Error in `geom_bar()`:
#> ! Problem while setting up geom aesthetics.
#> ℹ Error occurred in the 1st layer.
#> Caused by error in `check_aesthetics()` at ggplot2/R/geom-.R:181:5:
#> ! Aesthetics must be either length 1 or the same as the data (3).
#> ✖ Fix the following mappings: `width`.

Created on 2024-07-19 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions