myml / myml.github.io

myml的个人网站
https://myml.dev
3 stars 0 forks source link

用python画一个♥ #3

Open myml opened 7 years ago

myml commented 7 years ago

来自利用python进行数据分析

import matplotlib.pyplot as plt
import numpy
x, y=numpy.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], colors=["red"])
plt.gca().set_aspect("equal")
plt.show()