I am able to get a Surface Plot using matplotlib
with this code:
ax = figure.gca(projection = "3d")
ax.plot_surface(meshed_slopes, meshed_intercepts, errors.reshape(1, meshed_slopes.shape[0]), cmap = cm.autumn_r)
But when I try to do the same using Plotly I get a blank graph.
This is the code am using to plot the surface plot-
import plotly.graph_objects as go
import numpy as np
meshed_slopes, meshed_intercepts = np.meshgrid(slopes, intercepts)
fig = go.Figure(go.Surface(
x = meshed_slopes,
y = meshed_intercepts,
z = errors.reshape(1, meshed_slopes.shape[0])
))
fig.show()
How can I fix this?
Thanks in advance!!!
Since you haven't provided the data so we can take a look I'm going to explain what plotly needs to make the plot work:
I would suggest a dataframe as it might be easier for you to create everything
(Since I have low rep, I can't write comments so I'm posting this as an answear)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.