I have a question about how the plotly surface code works.
I've got the data from dataframe to plot surface 3D graph , 1D array of x , y and z
example :
x (temperatures) = [26,25,24,29,21,20,21,21,26]
y (humidity) = [50,60,50,40,50,70,80,90,90]
z (power consumption) = [12,13,14,11,11,10,11,12,15]
I need to plot each point (ex: x1,y1,z1) to be a surface and I have used this code
import plotly.graph_objects as go
import numpy as np
#x,y,z from above
fig = go.Figure(data = go.Surface(z=z,
x=x,
y=y))
fig.update_traces(contours_z = dict(show = True , usecolormap = True ,
highlightcolor = 'limegreen' , project_z = True))
fig.update_layout(title = 'Linear')
fig.show()
but it doesn't show anything.
(I also known that z need to be 2D array but I don't know why it is)
How can I fix this problem?
Thank you
