极客小将

您现在的位置是:首页 » python编程资讯

资讯内容

python画圆运用了什么函数

极客小将2021-03-11-
简介python画圆运用了matplotlb库的figure()和Circle()函数;其中,figure()函数用于确定画布大小,而Circle()函数用于配置圆的相关信息,进而画圆。本教程操作环境:windows7系统、Python3版、DellG3电脑。python画圆代码frommatplo

python画圆运用了matplotlb库的figure()和Circle()函数;其中,figure()函数用于确定画布大小,而Circle()函数用于配置圆的相关信息,进而画圆。H9Z少儿编程网-https://www.pxcodes.com

H9Z少儿编程网-https://www.pxcodes.com

本教程操作环境:windows7系统、Python3版、Dell G3电脑。H9Z少儿编程网-https://www.pxcodes.com

python画圆代码H9Z少儿编程网-https://www.pxcodes.com

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画圆运用了什么函数的详细内容,更多请关注少儿编程网其它相关文章!H9Z少儿编程网-https://www.pxcodes.com

网友点评

共有5条评论来说两句吧...

在线客服