0
点赞
收藏
分享

微信扫一扫

画心 画心形

扒皮狼 2022-06-16 阅读 97
import matplotlib.pyplot as plt
from matplotlib import animation
import numpy as np
import math

print(math.pi)
def drawHeart():
t = np.linspace(0, 3, 100000)
x = np.sin(t)
y = np.cos(t) + np.power(x, 0.5)
plt.plot(x, y, color='red', linewidth=10)
plt.plot(-x, y, color='red', linewidth=10)
# plt.xlabel('t')
# plt.ylabel('h')
plt.ylim(-2, 2)
plt.xlim(-2, 2)

plt.legend()
plt.show()


drawHeart()

 

-----------------------------------------------------------------------------------------------------------------------------------------

举报

相关推荐

0 条评论