R Plotly: Bugs in parcoords plot -
i'm experiencing strange bugs when working plotly
in r
when using parcoords
plot.
for example, using example provided here: https://plot.ly/r/parallel-coordinates-plot/
library(plotly) df <- read.csv("https://raw.githubusercontent.com/bcdunbar/datasets/master/iris.csv") df %>% plot_ly(type = 'parcoords', line = list(color = ~species_id, colorscale = list(c(0,'red'),c(0.5,'green'),c(1,'blue'))), dimensions = list( list(range = c(2,4.5), label = 'sepal width', values = ~sepal_width), list(range = c(4,8), constraintrange = c(5,6), label = 'sepal length', values = ~sepal_length), list(range = c(0,2.5), label = 'petal width', values = ~petal_width), list(range = c(1,7), label = 'petal length', values = ~petal_length) ) )
results in plot:
this whole plot, did not crop image on right. if move axes around, data flickers on , off , usually, rstudio crashes. here's sessioninfo:
> sessioninfo() r version 3.4.1 (2017-06-30) platform: x86_64-w64-mingw32/x64 (64-bit) running under: windows >= 8 x64 (build 9200) matrix products: default locale: [1] lc_collate=german_switzerland.1252 lc_ctype=german_switzerland.1252 lc_monetary=german_switzerland.1252 [4] lc_numeric=c lc_time=german_switzerland.1252 attached base packages: [1] stats graphics grdevices utils datasets methods base loaded via namespace (and not attached): [1] compiler_3.4.1 tools_3.4.1
and version of plotly
:
> packageversion('plotly') [1] ‘4.7.1’
does experience same problem? there solution this?
the problem in viewer of rstudio.
suggest add options(viewer=null)
in code.
disables internal viewer of rstudio , opens plot in browser.
library(plotly) options(viewer=null) df <- read.csv("https://raw.githubusercontent.com/bcdunbar/datasets/master/iris.csv") p <- df %>% plot_ly(type = 'parcoords', line = list(color = ~species_id, colorscale = list(c(0,'red'),c(0.5,'green'),c(1,'blue'))), dimensions = list( list(range = c(2,4.5), label = 'sepal width', values = ~sepal_width), list(range = c(4,8), constraintrange = c(5,6), label = 'sepal length', values = ~sepal_length), list(range = c(0,2.5), label = 'petal width', values = ~petal_width), list(range = c(1,7), label = 'petal length', values = ~petal_length) ) ) print(p)
Comments
Post a Comment