plotly / plotly/plotly.R

plotly does not work with coord_radial

Open
#2,430 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reported R example with coord_radial(inner.radius = 0.3) and ggplotly(p), then compare the failure with the related plotly.R issue 878. The work is complete when this example is converted without the get_labels error or the associated invalid-range warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
plotly, r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.