E 听 2021-03-05 23:54
浏览 116

如何解决ufunc 'square' not supported ……错误

fig = plt.figure()
ax = Axes3D(fig)

X=np.array(Length)
Y=np.array(Viscera)


X,Y=np.meshgrid(X,Y)

R=np.sqrt(X**2+Y**2)
#height value
Z=np.sin(R)

ax.plot_surface(X,Y,Z,rstride=1,cstride=1,cmap=plt.get_cmap('rainbow'))
ax.contourf(X,Y,Z,zdir='z',offset=-2,cmap='rainbow') #等高线图  即下面的部分
ax.set_zlim(-2,2)

改成列表和元组形式都出现一下错误

ufunc 'square' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

  • 写回答

0条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 登陆器jar2exe过期了怎么样重新授权
      • ¥15 matlab求解复杂不定积分
      • ¥15 我的电脑安装好的PS总是会自己消失,请问这是为什么?
      • ¥15 这个程序哪里有问题呢,显示0分
      • ¥15 我想问一下像图片中这种效果怎么实现
      • ¥20 关于#vue.js#的问题:el-tag拖放到 el-input框时无法完成填充(语言-javascript)
      • ¥15 python小游戏飞机大战空格发射子弹报错,添加旋转代码后陨石一直变大,不知道哪里出错了
      • ¥50 QT websocket·
      • ¥15 配置LED用PWM波点亮,但是LED与LCD的引脚复用问题导致PWM无法使能
      • ¥15 Python如何进行分数的求和