Passing `name` to fill and colour scales as unnamed first argument is broken in 4.0.0
Closed this issue · 1 comments
dmphillippo commented
Fill and colour scales no longer seem to support passing name as the first unnamed argument after v4.0.0.
ggplot(mtcars, aes(x = disp, y = hp, size = gear, colour = wt, fill = factor(cyl))) +
geom_point(shape = 21) +
scale_fill_discrete("Cylinders") + # Fill and colour scales are affected
scale_colour_continuous("Weight") + # Both discrete and continuous
scale_size_continuous("Gears") # Some(?) other scales are notExpecting the legend labels “Cylinders” and “Weight”. Explicitly passing name gives the expected result.
ggplot(mtcars, aes(x = disp, y = hp, size = gear, colour = wt, fill = factor(cyl))) +
geom_point(shape = 21) +
scale_fill_discrete(name = "Cylinders") +
scale_colour_continuous(name = "Weight") +
scale_size_continuous("Gears")This does not seem to affect all types of scales - e.g. size and alpha seem fine (I haven't checked them all!).
Created on 2025-09-18 with reprex v2.1.1
teunbrand commented
Thanks for the report! I can reproduce this, and this is a clear regression, I think.

