plotly / plotly/plotly.R

ggplotly() does not reflect axis/facet position changes in ggplot.

Open
#946 5 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I have changed the position of facet strips and axis in ggplot but those changes are not translated by ggplotly.

Example code:

dia = ggplot(diamonds[diamonds$cut %in% c("Fair", "Good"),], aes(x = cut)) + 
geom_bar(stat = "identity",aes(y=depth,fill = cut)) + 
facet_wrap(~color, nrow=1,strip.position = "bottom")+scale_x_discrete(position = "top")

The ggplot result is:
rplot

The result of ggplotly(dia) is:
rplot01

Session info --------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.3.3 (2017-03-06)
 system   x86_64, mingw32             
 ui       RStudio (1.0.136)           
 language (EN)                        
 collate  English_United States.1252  
 tz       America/New_York            
 date     2017-04-13                  

Packages ------------------------------------------------------------------------------------------------
 package     * version date       source        
 assertthat    0.1     2013-12-06 CRAN (R 3.3.3)
 base64enc     0.1-3   2015-07-28 CRAN (R 3.3.2)
 colorspace    1.3-2   2016-12-14 CRAN (R 3.3.3)
 DBI           0.6-1   2017-04-01 CRAN (R 3.3.3)
 devtools      1.12.0  2016-06-24 CRAN (R 3.3.3)
 digest        0.6.12  2017-01-27 CRAN (R 3.3.3)
 dplyr         0.5.0   2016-06-24 CRAN (R 3.3.3)
 ggplot2     * 2.2.1   2016-12-30 CRAN (R 3.3.3)
 gtable        0.2.0   2016-02-26 CRAN (R 3.3.3)
 htmltools     0.3.5   2016-03-21 CRAN (R 3.3.3)
 htmlwidgets   0.8     2016-11-09 CRAN (R 3.3.3)
 httr          1.2.1   2016-07-03 CRAN (R 3.3.3)
 jsonlite      1.4     2017-04-08 CRAN (R 3.3.3)
 labeling      0.3     2014-08-23 CRAN (R 3.3.2)
 lazyeval      0.2.0   2016-06-12 CRAN (R 3.3.3)
 magrittr      1.5     2014-11-22 CRAN (R 3.3.3)
 memoise       1.0.0   2016-01-29 CRAN (R 3.3.3)
 munsell       0.4.3   2016-02-13 CRAN (R 3.3.3)
 plotly      * 4.5.6   2016-11-12 CRAN (R 3.3.3)
 plyr          1.8.4   2016-06-08 CRAN (R 3.3.3)
 purrr         0.2.2   2016-06-18 CRAN (R 3.3.3)
 R6            2.2.0   2016-10-05 CRAN (R 3.3.3)
 Rcpp          0.12.10 2017-03-19 CRAN (R 3.3.3)
 scales        0.4.1   2016-11-09 CRAN (R 3.3.3)
 tibble        1.3.0   2017-04-01 CRAN (R 3.3.3)
 tidyr         0.6.1   2017-01-10 CRAN (R 3.3.3)
 viridisLite   0.2.0   2017-03-24 CRAN (R 3.3.3)
 withr         1.0.2   2016-06-20 CRAN (R 3.3.3)
 yaml          2.1.14  2016-11-12 CRAN (R 3.3.3)

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 provided ggplot2 example and comparing ggplot(dia) with ggplotly(dia), focusing on axis and facet-strip positions. Done means the ggplotly result reflects the top x-axis and bottom facet strips shown by the ggplot result.

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.