plotly 3D曲面投影填充

2024-09-29 19:14:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我遵循这一指南,用plotly(https://plot.ly/python/3d-surface-plots/)实现了等高线的曲面绘制。 我设法得到了三维表面和x,y,z平面上的3个投影,但我不能设法得到countorf投影(我的意思是填充投影线)

import plotly.plotly as py
import plotly.graph_objs as go
data = []
Z = df360_pivot.values.T
Y = df360_pivot.columns.values
X = df360_pivot.index.values

print(np.shape(X),np.shape(Y),np.shape(Z)) # printed (110,) (10,) (10, 110)
surface = go.Surface(x=X,
                     y=Y,
                     z=Z,
                     colorscale='Viridis',
                     contours=go.surface.Contours(
                         x=go.surface.contours.X(show=True,
                                                 usecolormap=True,
                                                 highlightcolor="#42f462",
                                                 project=dict(x=True)), #this is the line pjection but I cannot manage to have it filled as a surface
                         y=go.surface.contours.Y(show=True,
                                                 usecolormap=True,
                                                 highlightcolor="#42f462",
                                                 project=dict(y=True)), #this is the line pjection but I cannot manage to have it filled as a surface
                         z=go.surface.contours.Z(show=True,
                                                 usecolormap=True,
                                                 highlightcolor="#42f462",
                                                 project=dict(z=True)))) #this is the line pjection but I cannot manage to have it filled as a surface


data.append(surface)
print(len(data))

fig = go.Figure(data=data)
py.iplot(fig, filename='Parametric_plot')

Tags: truegodataasshownpplotlysurface

热门问题