3D Surface Plot Bug Report


#1

I have discovered some inconsistencies involving contour lines applied to 3D surface plots generated online.

  1. If the number of x entries (the number of columns selected for the z axis in the grid) is less than or equal to 8 then the contours will ignore the colour choice associated with them. Instead they show up as the underlying surface colour but I’m guessing without any lighting effects applied to them.

EDIT: It would appear that the above description was just a specific case. I found that under the X axis scene> ticks, if when set to linear, setting the reference to several orders of magnitude smaller than the data fixes the issue of contour lines not referencing their set colour correctly

  1. The Z contour visibility seems to be linked with the Y contour visibility. If only Z contour is enabled, it exhibits the issue outlined in my first point.

  2. If contours (properly functioning or not) are disabled, they essentially become white instead. The resolution to this seems to be to enable and then disable the respective dynamic contour option.

Hope this helps in solving the problem.


#2

Replying to an old post as this still appears to be a problem. Agree with @inkychris, surface contours in plotly (I’m using v 2.2.3) seems totally broken. I’m using a Pandas dataframe pivot as my data source. Using this to create the surface plot with all contour lines:

surface_data = go.Surface(
                        x=pivot.columns.values.tolist(),
                        y=pivot.index.values.tolist(),
                        z=pivot.values,
                        colorscale='Viridis',
                        contours=dict(
                            x=dict(show=True),
                            y=dict(show=True),
                            z=dict(show=True)
                        )
                    )

I get the following plot. (Note that, bizarrely, there are a couple of missing contours for the x axis).

Now if I remove the z axis contours:

contours=dict(
x=dict(show=True),
y=dict(show=True)
)

It seems to remove the x axis contours:

If i put the z contours back in and remove the x axis contours, it removes the z axis contours, and just for the fun of it, turns them white:

contours=dict(
y=dict(show=True),
z=dict(show=True)
)

Really, really bizarre. Hope this helps document the bug, and help anyone else who is struggling with this.