go.Figure for surface not on Z axes

I need to show a cube in 3d space, but go.Figure doesn’t show anything when it’s static y or x axes

Hi @MissSchiza welcome to the forums.

You could use the plotly.graph_opjects.Mesh3d for that:

an Example:

import plotly.graph_objects as go
import numpy as np

x, y, z = np.meshgrid([0, 1], [0, 1], [0, 1])

x = x.flatten()
y = y.flatten()
z = z.flatten()

fig = go.Figure(
    data=go.Mesh3d(
        x=x,
        y=y,
        z=z,
        alphahull=0,
        flatshading=True
    )
)
fig.show()

creates:
newplot(5)

mrep mesh3d

1 Like

Oh… Thank you so much! ‘’:slight_smile: