From 83dcccd2945900bfc9ace8831eb6a3f406794051 Mon Sep 17 00:00:00 2001 From: JElchison Date: Thu, 26 Dec 2024 16:23:12 -0500 Subject: [PATCH] Correct example to use colors instead of colorscale See https://github.com/plotly/plotly.R/issues/1846 --- r/2015-07-30-3d-scatter-plots.Rmd | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/r/2015-07-30-3d-scatter-plots.Rmd b/r/2015-07-30-3d-scatter-plots.Rmd index f1178127..bec3d1b9 100644 --- a/r/2015-07-30-3d-scatter-plots.Rmd +++ b/r/2015-07-30-3d-scatter-plots.Rmd @@ -40,7 +40,8 @@ fig library(plotly) fig <- plot_ly(mtcars, x = ~wt, y = ~hp, z = ~qsec, - marker = list(color = ~mpg, colorscale = c('#FFE1A1', '#683531'), showscale = TRUE)) + color = ~mpg, + colors = c('#FFE1A1', '#683531')) fig <- fig %>% add_markers() fig <- fig %>% layout(scene = list(xaxis = list(title = 'Weight'), yaxis = list(title = 'Gross horsepower'), @@ -52,7 +53,7 @@ fig <- fig %>% layout(scene = list(xaxis = list(title = 'Weight'), xref = 'paper', yref = 'paper', showarrow = FALSE - )) + )) fig ``` @@ -100,4 +101,4 @@ fig #Reference -See [https://plotly.com/r/reference/#scatter3d](https://plotly.com/r/reference/#scatter3d) for more information and chart attribute options! \ No newline at end of file +See [https://plotly.com/r/reference/#scatter3d](https://plotly.com/r/reference/#scatter3d) for more information and chart attribute options!