-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
Hi,
It seems that if the zaxis range is not set to 'auto' then the colors of the contour lines will default to the color of the surface itself. Here is a short code snippet that reproduces the bug.
import plotly.plotly as py
import plotly.graph_objs as go
import numpy as np
# Bug where contour lines cannot be colored if they don't all appear on the plotted surface.
def f(x,y):
return np.outer(x,y)
x = np.linspace(0.5,1,25)
y = np.linspace(0.5,1,25)
z = f(x,y)
surf = go.Surface( x=x,
y=y,
z=z,
contours = dict(z = dict(show=True,
color='#111')
)
)
layout = go.Layout(
scene = dict(
zaxis = dict(
rangemode = 'tozero'
)
)
)
fig = go.Figure(data=[surf],layout=layout)
py.plot(fig, filename = 'bug')With the rangemode option set to 'normal', we get the contour lines showing up as normal

But if we try to extend the z-axis to zero then the color of our contour lines changes to the colorscale of the plot. Note that in the example below the contour lines are still being plotted, their color has just changed.
I wasn't sure if this should be posted in the python or the js repo but as I found the bug in python I'm posting it here.
Best,
Peter #
Metadata
Metadata
Assignees
Labels
No labels
