Skip to content

"color" works with labs() but "colour" does not work when changing legend title #264

@yimingli

Description

@yimingli
df = pd.DataFrame({'x': [1, 2],
                   'y': [3, 4],
                   'cat': ['a', 'b']})

ggplot(df, aes('x', 'y', color = 'cat')) +\
    geom_point() +\
    labs(color = 'new legend title') # new title works

ggplot(df, aes('x', 'y', color = 'cat')) +\
    geom_point() +\
    labs(colour = 'new legend title') # new title does not work

ggplot(df, aes('x', 'y', colour = 'cat')) +\
    geom_point() +\
    labs(colour = 'new legend title') # new title also does not work when I use 'colour' in aes()

ggplot2 fixed some color-colour inconsistency recently: https://www.tidyverse.org/articles/2018/10/ggplot2-3-1-0/#minor-fixes-and-improvements

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions