Hi,
I have a 3D domain with data and trying to visualize slices of data in 3D space.
I can show the data by colours, but not by contours, What Im doing wrong?
import plotly.graph_objects as go
import numpy as np
d = [[-10,10,32], [-15,15,48], [-10,10,32]]
x_values = np.linspace(d[0][0], d[0][1], d[0][2])
y_values = np.linspace(d[1][0], d[1][1], d[1][2])
z_values = np.linspace(d[2][0], d[2][1], d[2][2])
X, Y, Z = np.meshgrid(x_values, y_values, z_values)
BB = np.sin(np.sqrt(X**2 + Y**2 + Z**2))
idx = 10
z_plane = BB[:, :, idx]
sp_z = go.Surface(
contours = {
"z": {"show": True, "start": BB.min(), "end": BB.max(), "size": 0.05, "color":"white"}
},
x=X[:, :, idx], y=Y[:, :, idx], z=Z[:, :, idx],
surfacecolor=z_plane,
colorscale='Hot', showscale=False, opacity=0.7)
fig = go.Figure(data=[sp_z])
fig.show()
Any advice would be great!