import numpy as np
points=np.arange(-5,5,0.01)
#1000个间隔相同的点
xs,ys=np.meshgrid(points,points)
#生成两个二维矩阵
print(ys)
import matplotlib.pyplot as plt
z=np.sqrt(xs ** 2 + ys ** 2)
#计算函数
print(z)
plt.imshow(z, cmap=plt.cm.gray);plt.colorbar()
plt.title("Image plot of $\sqrt{x^2 + y^2}$ for a grid of values")