站长资讯网
最全最丰富的资讯网站

python画圆运用了什么函数

python画圆运用了matplotlb库的figure()和Circle()函数;其中,figure()函数用于确定画布大小,而Circle()函数用于配置圆的相关信息,进而画圆。

python画圆运用了什么函数

本教程操作环境:windows7系统、Python3版、Dell G3电脑。

python画圆代码

from matplotlib.patches import Ellipse, Circle import matplotlib.pyplot as plt   def plot_cicle():     fig = plt.figure()     ax = fig.add_subplot(111)       cir1 = Circle(xy = (0.0, 0.0), radius=2, alpha=0.5)     ax.add_patch(cir1)       x, y = 0, 0     ax.plot(x, y, 'ro')       plt.axis('scaled')     plt.axis('equal')   #changes limits of x or y axis so that equal increments of x and y have the same length       plt.show()    plot_cicle()

python画圆运用了什么函数

赞(0)
分享到: 更多 (0)

网站地图   沪ICP备18035694号-2    沪公网安备31011702889846号