Skip to content

Support ggplot2's custom group labelling #943

Open
@mrfoliveira

Description

@mrfoliveira

Hi,

I found issues related to ggplot2's legend positioning, but couldn't find any addressing the fact that ggplotly ignores group labels changed by scale_color_discrete (or similar).
In contrast, it is able to handle a change in tick labels done in a similar manner using scale_x_discrete. You can find an example below with the iris dataset.
It would be great if you could add support to this!

# change in tick labels supported
gg <- ggplot(iris, aes(x=Species, y=Sepal.Width)) + 
geom_boxplot() + 
scale_x_discrete(labels=c("a", "b", "c)"))
gg
ggplotly(gg)

# change in group labels not supported
gg <- ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, group=Species, color=Species)) + 
geom_point() +
scale_color_discrete(labels=c("a", "b", "c"))
gg
ggplotly(gg)

Great work!
Mariana Oliveira

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions