The error message is indicating that the input variable "Z" in the line "contour = ax.contour3D(X, Y, Z, data, levels=[volume], colors='blue')" should be a 2D array, but it is currently a 3D array.

To fix this error, you need to make sure that the "Z" variable is a 2D array before passing it to the contour3D function. You can try reshaping or slicing the array to remove the extra dimension.

Traceback most recent call last File Ethreepicturethreepicturepy line 20 in module contour = axcontour3DX Y Z data levels=volume colors=blue File Ethreepicturevenvlibsite-packagesmatplotlib__init

原文地址: https://www.cveoy.top/t/topic/hGiu 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录