Skip to content

Scale manual dummy legend not showing icon #6223

Closed
@rfgoldberg

Description

@rfgoldberg

Hello, I found a problem with scale_fill_manual.

When running the following code, I expected a second legend icon to appear for test, but it does not. This issue does not occur with an older version of ggplot (3.4.4), only with 3.5.1.

Reprex below:

library(dplyr)
library(ggplot2)

iris |> 
filter(Species == "setosa")  |> 
ggplot() + 
  geom_boxplot(aes(x = Species, y = Petal.Width,fill = Species)) + 
  scale_fill_manual(values = c("red","blue"), limits = c("setosa","test"), labels = c("setosa","test"))

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions