加入这个就可以了:
加入:from mpl_toolkits.mplot3d import Axes3D
import tensorflow as tf
import matplotlib
from matplotlib import pyplot as plt
#导入三维坐标支持
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
x=tf.linspace(-8.,8,100)#设置x轴的采样点
y=tf.linspace(-8.,8,100)#设置y轴的采样点
x,y=tf.meshgrid(x,y)#生成网格点,并内部拆分后返回
#x.shape,y.shape#打印拆分后的所有点的x,y坐标张量tensor
z=tf.sqrt(x**2+y**2)
z=tf.sin(z)/2
fig=plt.figure()
ax=Axes3D(fig)
#根据网格绘点制sinc函数三维曲面
ax.contour3D(x.numpy(),y.numpy(),z.numpy(),50)
plt.show()