我使用plotly 在一个带有颜色渐变的闪亮应用程序中渲染3D 散点图。虽然基本散点图本身没有问题,但我似乎无法更改颜色渐变的颜色,即使对于此处提供的示例也是如此: https: //plotly.com/r/3d-scatter-plots/。(参见代码片段)。
我尝试了标准颜色和十六进制的多种颜色组合。
library(plotly)
fig <- plot_ly(mtcars, x = ~wt, y = ~hp, z = ~qsec,
marker = list(color = ~mpg, colorscale = c('#FFE1A1', '#683531'), showscale = TRUE))
fig <- fig %>% add_markers()
fig <- fig %>% layout(scene = list(xaxis = list(title = 'Weight'),
yaxis = list(title = 'Gross horsepower'),
zaxis = list(title = '1/4 mile time')),
annotations = list(
x = 1.13,
y = 1.05,
text = 'Miles/(US) gallon',
xref = 'paper',
yref = 'paper', …Run Code Online (Sandbox Code Playgroud)