刚学我也不熟,做个笔记吧 # coding:utf-8 import numpy as np import matplotlib.pyplot as plt dx = 0.01 dy = 0.01 # x的范围 x = np.arange(-2.0, 2.0, dx) # y的范围 y = np.arange(-2.0, 2.0, dy) # 生成二维网格矩阵 X, Y = np.meshgrid(x, y) # 定义函数生成三维结构 def f(x, y): return (1 - y **…