Skip to content

ggplotly broken under lastest ggplot2 dev version? #1561

Closed
@lozalojo

Description

@lozalojo

Seems that ggplot2 dev version 3.2.0.9000 has broken something in ggplotly.

First, with ggplot2 stable version (the result is as expected), the names of the labels of x-axis.
Second, with ggplot2 dev version (the result is NA), no names of labels.

Both tests made with lastest stable plotly version 4.9.0 under lastest R-devel for Windows 10.

Using stable version of ggplot2 3.2.0

library(plotly)
#> Loading required package: ggplot2
#> 
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#> 
#>     last_plot
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> The following object is masked from 'package:graphics':
#> 
#>     layout
p <- ggplot(iris) +
  geom_point(aes(x = Petal.Width, y = Sepal.Length, color = Species)) +
  scale_x_continuous(breaks = seq(0,3,0.5), limits =c(0,3), labels = letters[1:7])
gg <- ggplotly(p)
gg$x$layout$xaxis$ticktext
#> [1] "a" "b" "c" "d" "e" "f" "g"

Using the lastest dev version of ggplot2:

library(plotly)
#> Loading required package: ggplot2
#> 
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#> 
#>     last_plot
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> The following object is masked from 'package:graphics':
#> 
#>     layout
p <- ggplot(iris) +
  geom_point(aes(x = Petal.Width, y = Sepal.Length, color = Species)) +
  scale_x_continuous(breaks = seq(0,3,0.5), limits =c(0,3), labels = letters[1:7])
gg <- ggplotly(p)
gg$x$layout$xaxis$ticktext
#> [1] NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions