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

plotly does not work with coord_radial

Open nc011 opened this issue 10 months ago • 1 comments

Released last year, coord_radial is the "new" way of producing polar plots in ggplot.

Unfortunately, we cannot use ggplotly with this method.

Example:

 p <- ggplot(mpg, aes(displ, hwy)) +
  geom_point() +
coord_radial(inner.radius = 0.3)

ggplotly(p)

results in:

Error in rng[[xy]]$get_labels() : attempt to apply non-function In addition: Warning messages: 1: In min(z[["x"]]$dimension %()% z$x.range %||% z$x_range) : no non-missing arguments to min; returning Inf 2: In max(z[["x"]]$dimension %()% z$x.range %||% z$x_range) : no non-missing arguments to max; returning -Inf 3: In min(z[["y"]]$dimension %()% z$y.range %||% z$y_range) : no non-missing arguments to min; returning Inf 4: In max(z[["y"]]$dimension %()% z$y.range %||% z$y_range) : no non-missing arguments to max; returning -Inf

I assume this is linked to https://github.com/plotly/plotly.R/issues/878 but wanted to flag in case it's a separate issue.

nc011 avatar Mar 05 '25 12:03 nc011

Thanks for flagging this, from the outside it looks like it might be tricky to implement, but good to be aware.

romanzenka avatar Mar 07 '25 16:03 romanzenka