Skip to content

Warning message when adding a manual scale in ggplot #3127

Closed
@SavasAli

Description

@SavasAli

On Stackoverflow they suggested to report my question as a bug, so here it is:

When I add a manual scale like in the example below. I get the following error message:
"Warning message: In if (self$guide == "none") return() : the condition has length > 1 and only the first element will be used"

d <- data.frame(week = seq(1, 52, 1), 
            revenue = round(runif(52, 0, 100)), 0)

p <- ggplot(data = d, aes(x = week, y = revenue, fill = 'lightskyblue')) + 
  geom_bar(stat = 'identity', colour = 'black') 


p <- p + scale_fill_identity(name = NULL,
                             guide = guide_legend(label.position = 'top'),
                             labels = c('2019'))

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