Skip to content

scale_fill_discrete() no longer allows empty arguments #6710

@jmbarbone

Description

@jmbarbone

scale_fill_discrete() now breaks with trailing ,

packageVersion("ggplot2")
#> [1] '4.0.0'
try(ggplot2::scale_fill_discrete(breaks = 1:2, direction = -1L,))
#> Error in list2(...) : Argument 3 can't be empty.

Created on 2025-10-21 with reprex v2.1.1

packageVersion("ggplot2")
#> [1] '3.5.2'
ggplot2::scale_fill_discrete(breaks = 1:2, direction = -1L,)
#> <ggproto object: Class ScaleDiscrete, Scale, gg>
#>     aesthetics: fill
#>     axis_order: function
#>     break_info: function
#>     break_positions: function
#>     breaks: 1 2
#>     call: call
#>     clone: function
#>     dimension: function
#>     drop: TRUE
#>     expand: waiver
#>     get_breaks: function
#>     get_breaks_minor: function
#>     get_labels: function
#>     get_limits: function
#>     get_transformation: function
#>     guide: legend
#>     is_discrete: function
#>     is_empty: function
#>     labels: waiver
#>     limits: NULL
#>     make_sec_title: function
#>     make_title: function
#>     map: function
#>     map_df: function
#>     n.breaks.cache: NULL
#>     na.translate: TRUE
#>     na.value: grey50
#>     name: waiver
#>     palette: function
#>     palette.cache: NULL
#>     position: left
#>     range: environment
#>     rescale: function
#>     reset: function
#>     train: function
#>     train_df: function
#>     transform: function
#>     transform_df: function
#>     super:  <ggproto object: Class ScaleDiscrete, Scale, gg>

Created on 2025-10-21 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions