要求在下面图片中,需要有注释

越简单越好,写下注释。谢谢。如果对一定及时采纳,感谢各位。一定采纳的我。

img


import matplotlib.pyplot as plt
import matplotlib.patches as pc
import numpy as np
# 创建窗口
fig1 = plt.figure()
ax1 = fig1.add_subplot(121) # 创建子图1
plt.xlim(0,20)
plt.ylim(0,20)
plt.axis("equal")
# 定义圆心
center = np.array([9,9])
ax1.add_patch(pc.Circle(center,5)) # 画圆
ax2 = fig1.add_subplot(122) # 创建子图2
# 画等边三角形的过程就是确定3个点,然后画直线即可
# 设左下角的点为(5,5),变成为10
# 可推测右下角的点(15,5)
# 顶点(10,sqrt(10**2 - 5 ** 2))
p1 = (5,5)
p2 = (15,5)
p3 = (10,(10 ** 2 - 5 ** 2) ** 0.5)
# 画四条直线,根据三个顶点
triangleX = [p1[0],p2[0],p3[0],p1[0]] 
triangleY = [p1[1],p2[1],p3[1],p1[0]]
plt.axis("equal")
plt.plot(triangleX,triangleY,"green")
plt.show() # 显示

结果:

img

如果觉得答案对你有帮助,请点击下采纳,谢谢~