Skip to content

scale_color_discrete() produces two legends #2

Open
@friendly

Description

@friendly

There is something wrong in the code concerning legends for groups when you try to use scale_color_discrete() to set a property.
This has to do with the use of color and fill in geom_polygon().

The following example produces two legends:

data(wine)
wine.pca <- prcomp(wine, scale. = TRUE)
ggbiplot(wine.pca, obs.scale = 1, var.scale = 1,
  groups = wine.class, ellipse = TRUE, circle = TRUE) +
  scale_color_discrete(name = '') +
  theme(legend.direction = 'horizontal', legend.position = 'top')

See the result at:
https://github.com/friendly/ggbiplot/blob/master/man/figures/README-wine-biplot-1.png

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions