Skip to content

Surface plot axis title broken #393

Closed
@quartox

Description

@quartox

When using the surface plot, I am unable to change the axis labels using layout (taken from the documentation from https://plot.ly/r/reference/#layout-scene-xaxis).

PlotlySurface <- function(xAxis,yAxis,marginalEffect,variableNames) {
  axesNames <- lapply(1:2, function(index) {
    list(title = variableNames[index])
  })
  plot_ly(x=xAxis,y=yAxis,z=marginalEffect,type='surface') %>%
    layout(xaxis = axesNames[[1]], yaxis = axesNames[[2]])
}

This does change the axis names from default (the x axis would be labeled "xAxis" otherwise) but does not give the names that I specify from "variableNames" (which is a character vector with the names of the variables).

capture

I have included my devtools session info below.

devtools::session_info()
Session info ------------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.2.2 (2015-08-14)
 system   x86_64, mingw32             
 ui       RStudio (0.97.551)          
 language (EN)                        
 collate  English_United States.1252  
 tz       America/Los_Angeles         
 date     2016-01-13                  

Packages ----------------------------------------------------------------------------------------------------------------------
 package     * version  date       source        
 base64enc     0.1-3    2015-07-28 CRAN (R 3.2.2)
 colorspace    1.2-6    2015-03-11 CRAN (R 3.2.2)
 devtools      1.9.1    2015-09-11 CRAN (R 3.2.2)
 digest        0.6.8    2014-12-31 CRAN (R 3.2.2)
 gbm         * 2.1.1    2015-03-11 CRAN (R 3.2.2)
 ggplot2     * 2.0.0    2015-12-18 CRAN (R 3.2.3)
 gridExtra     2.0.0    2015-07-14 CRAN (R 3.2.2)
 gtable        0.1.2    2012-12-05 CRAN (R 3.2.2)
 htmltools     0.3      2015-12-29 CRAN (R 3.2.3)
 htmlwidgets   0.5      2015-06-21 CRAN (R 3.2.3)
 httr          1.0.0    2015-06-25 CRAN (R 3.2.2)
 jsonlite    * 0.9.16   2015-04-11 CRAN (R 3.2.2)
 lattice     * 0.20-33  2015-07-14 CRAN (R 3.2.2)
 magrittr      1.5      2014-11-22 CRAN (R 3.2.2)
 memoise       0.2.1    2014-04-22 CRAN (R 3.2.2)
 munsell       0.4.2    2013-07-11 CRAN (R 3.2.2)
 plotly      * 2.0.16   2015-12-20 CRAN (R 3.2.3)
 plyr          1.8.3    2015-06-12 CRAN (R 3.2.2)
 R6            2.1.1    2015-08-19 CRAN (R 3.2.2)
 Rcpp          0.12.1   2015-09-10 CRAN (R 3.2.2)
 rstudio       0.97.551 2015-08-26 local         
 rstudioapi    0.3.1    2015-04-07 CRAN (R 3.2.2)
 scales        0.3.0    2015-08-25 CRAN (R 3.2.2)
 stringi       0.5-5    2015-06-29 CRAN (R 3.2.2)
 stringr       1.0.0    2015-04-30 CRAN (R 3.2.2)
 survival    * 2.38-3   2015-07-02 CRAN (R 3.2.2)
 viridis       0.3.2    2015-12-31 CRAN (R 3.2.3)
 yaml          2.1.13   2014-06-12 CRAN (R 3.2.3)

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