简体   繁体   English

matplotlib plot_surface,如何使值/表面交叉显示?

[英]matplotlib plot_surface, how to make value/surface intersections show?

I am using plot_surface to create the following graph 我正在使用plot_surface创建以下图表

    surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet,
        linewidth=0, antialiased=True, shade=False)

在此输入图像描述

I want to be able to add in some indication of where the z-axis zero-plane intersects the surface. 我希望能够添加一些关于z轴零平面与曲面相交的指示。 That is every point on the surface which is Am3+Ae3 = 0 or nearest Am3+Ae3 = 0. 即表面上的每个点都是Am3 + Ae3 = 0或最接近的Am3 + Ae3 = 0。

Is there some function that will do this in matplotlib, or perhaps some way to make cmap show a very defined black around that zero value? 是否有一些函数可以在matplotlib中执行此操作,或者某些方法可以使cmap在该零值周围显示非常明确的黑色?

Thanks for any help. 谢谢你的帮助。

You have hit a limitation of matplotlib, it draws in layers so you can't automatically have intersections of surfaces in 3D (yet). 您已经达到了matplotlib的限制,它会在图层中绘制,因此您无法自动在3D中进行曲面交叉(尚未)。 You can fake it by hand (see How to draw intersecting planes? ) or use mayavi from enthought (which is openGL based and does 'real' 3D rendering) 您可以手工伪装(请参阅如何绘制相交平面? )或使用来自mayavi (基于openGL并执行'真实'3D渲染)

You can definitely do this with color map, but requires a bit of work (see stacking colormaps ). 您绝对可以使用颜色贴图执行此操作,但需要一些工作(请参阅堆叠彩色贴图)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM