I would like to plot 3 stacked surfaces sharing the same colorbar and colorscale. I would like the colorbar to have 11 ticks in [0.0, 0.1, ..., 0.9, 1.0].
For some reason I can't seem to get plotly to use the same colorbar and scale for all the three graphs. Right now they all have their own colorscale. I can have it print the colorbar only once, but they will still have different scales.
Here is my code:
def plot_3d(plot_dict, title):
data = []
for i in range(3):
dataset = plot_dict[kernels[i]]
data.append(
go.Surface(
x=C_2d_range,
y=gamma_2d_range,
z=dataset,
#showscale=True if i == 0 else False,
colorbar=dict(
nticks=11,
tickmode='array',
tickvals=[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
),
colorscale='Viridis'
)
)
layout = go.Layout(
title=title,
scene = dict(
xaxis = dict(
title='C parameter'
),
yaxis = dict(
title='Gamma parameter'
),
zaxis = dict(
title='F1 Score'
)
)
)
fig = go.Figure(data=data, layout=layout)
ply.iplot(fig, filename=title)
But it produces where each plot is clearly using its own scale. Just to be clear in this case I would like to surface on the bottom to be dark and the one on the top to be yellow.
Thanks for any help.