I was hoping to plot two orthogonal planes using the Surface graph_object. However, it is seemingly apparent that the shape of the data for z must be two-dimensional (such that x and y are the unique coordinates corresponding in indices to the 2D array that makes up z data). Is there a way to implement this functionality in x or y? I.e.
The data the describes the coordinates of the surface is set in z . Data in z should be a 2D list. Coordinates in x and y can either be 1D lists or 2D lists (e.g. to graph parametric surfaces). If not provided in x and y ,
Planes one represent as a parameterized surface, not as a graph of function of two variables:
import plotly.graph_objects as go
import numpy as np
u, v = np.meshgrid(np.linspace(-1, 2, 100),np.linspace(-1,1, 100))
#Surface z=1.5
x = u
y = v
z = 1.5*np.ones(u.shape)
fig= go.Figure(go.Surface(x=x, y=y, z=z, coloraxis="coloraxis"))
#Surface y =0.5
s, t = np.meshgrid(np.linspace(-1, 2, 100), np.linspace(-1, 2, 100))
X = s
Z = t
Y = 0.5*np.ones(s.shape)
fig.add_surface(x=X, y=Y, z=Z, coloraxis="coloraxis")
fig.update_layout(width=500, height=500, font_size=11,
coloraxis=dict(colorscale=[[0, "rgb(200,200,200)"],[1, "rgb(200,200,200)"]],
colorbar_thickness=24, showscale=False),
scene_camera_eye=dict(x=1.5, y=1.5, z=1))