Python 绘制隐函数图像

import numpy as np
import matplotlib.pyplot as plt

x, y = np.mgrid[-2:2:500j, -2:2:500j]
z = (x ** 2 + y ** 2 - 1) ** 3 - x ** 2 * y ** 3
plt.contourf(x, y, z, levels=[-1, 0])
plt.gca().set_aspect('equal')
plt.show()

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_44864262/article/details/108469785