用绘图法绘制一个交互式三维曲面(去吧。浮出水面),则生成的曲面不在原点居中。它在(10,10)处居中,轴从0到20。我希望它在原点居中,轴被限制在-5到5之间。如果有人能帮我那就太好了。在
x = np.arange(-5,5,0.01)
y = np.arange(-5,5,0.01)
xx,yy=np.meshgrid(x,y)
Z=xx**2+yy**2
data = [go.Surface(z=Z.tolist(), colorscale='Viridis')]
layout = go.Layout(
...
code here
...
)
fig = dict(data=data, layout=layout)
plotly.offline.plot(fig, filename='pandas-3d-surface')
可以指定X轴和Y轴的范围,如下所示:
请注意,这需要在数据中显式指定
^{pr2}$x
和y
轴:输出:
参见official Plotly examples
相关问题 更多 >
编程相关推荐