I am trying to change the colorscale for a contour plot, if I try to use RGB values or preset values (https://github.com/plotly/plotly.js/blob/5bc25b490702e5ed61265207833dbd58e8ab27f1/src/components/colorscale/scales.js) nothing changes, am I missing something?
I have tried copying code directly from an online plot e.g.
colorscale = list(c(0, "rgb(4, 4, 21)"),list(0.35, "rgb(98, 24, 127)"),list(0.5, "rgb(176, 52, 122)"),list(0.6, "rgb(250, 129, 94)"),list(0.7, "rgb(254, 185, 127)"),list(1, "rgb(252, 234, 172)")),
I get this warning in console:
Warning message:
In strip_alpha(traces[[i]]$colorscale[, 2]) :
Ignoring an alpha value lower than 1
I do not get the warning when using a preset but it still doesn’t work.
Here is the trace part of my script:
p <- plot_ly(x = mydata[[1]],width=1450,height=900)%>%
add_trace(
y = mydata[[2]],
z = zdata,
autocolorscale = FALSE,
autocontour = FALSE,
colorscale = list(c(0, "rgb(4, 4, 21)"),list(0.35, "rgb(98, 24, 127)"),list(0.5, "rgb(176, 52, 122)"),list(0.6, "rgb(250, 129, 94)"),list(0.7, "rgb(254, 185, 127)"),list(1, "rgb(252, 234, 172)")),
connectgaps = TRUE,
contours = list(
coloring = "fill",
end = 80,
showlines = TRUE,
size = 1,
start = 60
),
line = list(
dash = "solid",
width = 0.5
),
ncontours = 17,
opacity = 1,
reversescale = FALSE,
showscale = TRUE,
transpose = TRUE,
type = "contour",
xtype = "array",
ytype = "array",
zauto = FALSE,
zmax = 200,
zmin = 0
)%>%
Can anyone help?