Skip to content

Categorical ggplotly legend no longer interpreted as categorical when two aesthetics are used #2354

Closed
@LukasWallrich

Description

@LukasWallrich

When showing a legend for categorical data, ggplotly works fine when only one aesthetic is used - but switches to show intervals rather than categories as soon as two different aesthetics are used.


Looking good:

p <- ggplot(mtcars, aes(wt, mpg)) + geom_boxplot(aes(col = factor(am))) + geom_rug(aes(col = factor(am)))
ggplotly(p)

image

Not looking good (just concerned about the legend, also fails where fill aesthetic works):

p <- ggplot(mtcars, aes(wt, mpg)) + geom_boxplot(aes(fill = factor(am))) + geom_rug(aes(col = factor(am)))
ggplotly(p)

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