Skip to content

geom_text_repel not working in plotly.... #1071

Closed
@rajan5660

Description

@rajan5660

#load the data
data <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/school_earnings.csv")

#bubble chart with ggplot
g<-ggplot(data, aes(x = Women, y = Men, label =School ))+
geom_point(aes(size =gap,alpha=0.5),shape=21, stroke = 0.5,colour = "black")+
geom_text_repel(size = 3,fontface = 'bold', color = 'black',segment.alpha = 0,segment.color = 'grey50' )

#plot output with ggplot
g
image

#using ggplolty to convert ggplot to plolty
ggplotly(g)

#plot output with ggplotly

image

But this did not print text of bubbles and give warning

Warning messages:
1: We recommend that you use the dev version of ggplot2 with ggplotly()
Install it with: devtools::install_github('hadley/ggplot2')
2: In geom2trace.default(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]]) :
geom_GeomTextRepel() has yet to be implemented in plotly.
If you'd like to see this geom implemented,
Please open an issue with your example code at
https://github.com/ropensci/plotly/issues

image

I am using ggplot to render the plot because i didn't found any way in plotly to repel the overlapping labels when the number of bubbles are more on plot

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