plotly.R icon indicating copy to clipboard operation
plotly.R copied to clipboard

unexpected results using ggplotly and geom_dotplot()

Open juliasilge opened this issue 7 years ago • 2 comments

Hello! Thank you so much for your work on this great package.

I am having some trouble getting dot plots to work with plotly. For example, take a look at the following example from the documentation for geom_dotplot().

library(ggplot2)

p <- ggplot(mtcars, aes(x = factor(cyl), y = mpg)) +
  geom_dotplot(binaxis = "y", stackdir = "center")

p
#> `stat_bindot()` using `bins = 30`. Pick better value with `binwidth`.

Created on 2018-03-07 by the reprex package (v0.2.0).

When I then try to render this with plotly:

library(plotly)
ggplotly(p)

I get a blank plot.

rplot

I am getting lots of weird problems like this with my real data as well.

juliasilge avatar Mar 07 '18 20:03 juliasilge

I'm getting a problem with dotplots as well and given how few handles for data layers there are here, it'd be great to be able to add tooltips to them.

ggplot(callData, aes(callName, jobDuration)) +
    geom_dotplot(binaxis = "y", stackdir = "center", 
                 binwidth = 1, method="histodot",
                 width = 0.8, alpha = 0.8,
                 aes(fill = executionStatus)) +
    theme_minimal() +
    theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
    scale_fill_brewer(type = "qualitative", palette = "Set1") + 
    ylab("Job Duration (mins)") +
    xlab("Call Name")

Screen Shot 2019-05-03 at 9 58 16 AM

ggplotly(a)

Screen Shot 2019-05-03 at 9 59 05 AM

vortexing avatar May 03 '19 17:05 vortexing

hello, were you ever able to resolve this issue?

jeffreyohene avatar Jan 29 '24 14:01 jeffreyohene