plotly / plotly/plotly.R

Modified axis tick label in a `ggplot` object do not render in the `ggplotly` call

Open
#1,145 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The axis tick labels generated byscales::math_format in aggplot object do not render in the ggplotly object. (Also, the annotation_logticks generates an warning that "geom_GeomLogticks() has yet to be implemented in plotly." Addressing that geom will be noted as a second issue, #1146)

library(ggplot2) # version 2.2.1
library(plotly)  # version 4.7.1

g <-
  ggplot(txhousing) +
  aes(x = date, y = log10(volume)) +
  geom_point() +
  scale_y_continuous(labels = scales::math_format(10^.x)) +
  annotation_logticks(side = "l")
g

ggplot

ggplotly(g)

newplot 1

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 reproducible R example with plotly, ggplot2, and scales, then compare the ggplot and ggplotly axis labels. Trace how scales::math_format labels are transferred into the ggplotly object. Done means the modified tick labels render in ggplotly; annotation_logticks is separately tracked in issue #1146.

Written by the indexing model from the issue text.

Assessment

Tech stack
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.